LongoMatch.DB.DataBase.GetProject C# (CSharp) Method

GetProject() public method

public GetProject ( System.Guid id ) : Project
id System.Guid
return Project
        public Project GetProject(Guid id)
        {
            string projectFile = Path.Combine (dbDirPath, id.ToString ());

            if (File.Exists (projectFile)) {
                try {
                    return serializer.Load<Project> (projectFile);
                } catch (Exception ex) {
                    throw new ProjectDeserializationException (ex);
                }
            } else {
                throw new ProjectNotFoundException (projectFile);
            }
        }

Usage Example

Esempio n. 1
0
        public static void Main(string[] args)
        {
            /* Start DB services */
            Core.Init();
            var db = new DataBase(Path.Combine(Config.DBDir(),Constants.DB_FILE));
            Project p = db.GetProject(db.GetAllProjects()[0].UUID);

            ExcelExporter ee = new ExcelExporter();
            ee.ExportProject(p,  "/home/andoni/test.xls");
        }
All Usage Examples Of LongoMatch.DB.DataBase::GetProject