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(); } }
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(); }