コード例 #1
0
        public async Task <Plan> Get()
        {
            var plan = new Plan();

            plan.Resources        = (await PlanResources.FindAsync(_ => true)).ToList();
            plan.Assignments      = (await PlanAssignments.FindAsync(_ => true)).ToList();
            plan.NotAssignedTasks = (await PlanNotAssignedTasks.FindAsync(_ => true)).ToList();

            return(plan);
        }
コード例 #2
0
        public async Task Save(Plan plan)
        {
            await PlanResources.DeleteManyAsync(_ => true);

            await PlanAssignments.DeleteManyAsync(_ => true);

            await PlanNotAssignedTasks.DeleteManyAsync(_ => true);

            if (plan.Resources.Count > 0)
            {
                await PlanResources.InsertManyAsync(plan.Resources);
            }
            if (plan.Assignments.Count > 0)
            {
                await PlanAssignments.InsertManyAsync(plan.Assignments);
            }
            if (plan.NotAssignedTasks.Count > 0)
            {
                await PlanNotAssignedTasks.InsertManyAsync(plan.NotAssignedTasks);
            }
        }