示例#1
0
        private static void CreateWealthEconomy(BackboneContext context, User wealthAdmin)
        {
            var projectStore = context.Set <Project>();

            // Sample projects
            var billionDollarQuestion = CreateBillionDollarQuestion(wealthAdmin);
            var priorityIndexSample   = CreatePriorityIndexSample(wealthAdmin);
            var knowledgeIndexSample  = CreateKnowledgeIndexSample(wealthAdmin);
            var knowledgeIndexSoftwareLicenseSample = CreateKnowledgeIndexSoftwareLicenseSample(wealthAdmin);
            var allInOneSample = CreateAllInOneSample(wealthAdmin);

            // Set Id fields explicitly, since strangely EF doesn't save them in the order that they've been added to ProjectSet.
            // And they're referred with these Ids on front-end samples
            billionDollarQuestion.Id = 1;
            priorityIndexSample.Id   = 2;
            knowledgeIndexSample.Id  = 3;
            knowledgeIndexSoftwareLicenseSample.Id = 4;
            allInOneSample.Id = 5;

            // Insert
            projectStore.Add(billionDollarQuestion);
            projectStore.Add(priorityIndexSample);
            projectStore.Add(knowledgeIndexSample);
            projectStore.Add(knowledgeIndexSoftwareLicenseSample);
            projectStore.Add(allInOneSample);

            // First save
            context.SaveChanges();
        }
示例#2
0
 public ProjectManager()
 {
     _elementStore          = _context.Set <Element>();
     _elementCellStore      = _context.Set <ElementCell>();
     _elementFieldStore     = _context.Set <ElementField>();
     _elementItemStore      = _context.Set <ElementItem>();
     _projectStore          = _context.Set <Project>();
     _userElementCellStore  = _context.Set <UserElementCell>();
     _userElementFieldStore = _context.Set <UserElementField>();
 }