예제 #1
0
        private static void AddUser(RatDbContext context)
        {
            var user = context.Users.FirstOrDefault(x => x.UserId == TestUserProvider.UserId);

            if (user == null)
            {
                context.Users.Add(new UserEntity {
                    UserId = TestUserProvider.UserId
                });

                context.SaveChanges();
            }
        }
예제 #2
0
        private static void AddProjectType(RatDbContext context, string name)
        {
            var projectType = context.ProjectTypes.FirstOrDefault(x => x.Name == name);

            if (projectType == null)
            {
                context.ProjectTypes.Add(new ProjectTypeEntity {
                    Name = name
                });
            }

            context.SaveChanges();
        }