Example #1
0
        private static void AddExampleEstimationProjects(EstimatorContext context)
        {
            var projects = new ProjectEstimation[]
            {
                new ProjectEstimation {
                    Name = "Contoso ELearning", Description = "ELearning environment of Contoso Oy"
                },
                new ProjectEstimation {
                    Name = "Example Oy Web Banking", Description = "Web banking portal for Example Oy"
                }
            };

            context.AddRange(projects.ToList());
        }
Example #2
0
        public static void Initialize(EstimatorContext context)
        {
            if (!context.User.Any())
            {
                AddExampleUsers(context);
            }

            if (!context.ProjectEstimations.Any())
            {
                AddExampleEstimationProjects(context);
            }

            context.SaveChanges();
        }
Example #3
0
        private static void AddExampleUsers(EstimatorContext context)
        {
            var users = new User[]
            {
                new User {
                    Name = "User 1"
                },
                new User {
                    Name = "User 2"
                }
            };

            foreach (User user in users)
            {
                context.Add(user);
            }
        }
Example #4
0
 public ProjectController(EstimatorContext context)
 {
     _context = context;
 }
Example #5
0
 public EstimateService(EstimatorContext context)
 {
     this.context = context;
 }
Example #6
0
 public UserController(EstimatorContext context)
 {
     _context = context;
 }