private static async Task BuildRelations(Member entity, TimeContext context) { entity.Team = await context.Teams.FindAsync(entity.Team.Id); entity.Role = await context.Roles.FindAsync(entity.Role.Id); entity.Employee = await context.People.FindAsync(entity.Employee.Id); }
public static async Task Build <T>(this T entity, TimeContext context) { if (typeof(T) == typeof(Member)) { await BuildRelations(entity as Member, context); } if (typeof(T) == typeof(Project)) { await BuildRelations(entity as Project, context); } if (typeof(T) == typeof(Day)) { await BuildRelations(entity as Day, context); } if (typeof(T) == typeof(Detail)) { await BuildRelations(entity as Detail, context); } if (typeof(T) == typeof(User)) { BuildPassword(entity as User); } }
public UnitOfWork(TimeContext context) { _context = context; }
private static async Task BuildRelations(Detail entity, TimeContext context) { entity.Day = await context.Calendar.FindAsync(entity.Day.Id); entity.Project = await context.Projects.FindAsync(entity.Project.Id); }
private static async Task BuildRelations(Day entity, TimeContext context) { entity.Employee = await context.People.FindAsync(entity.Employee.Id); }
private static async Task BuildRelations(Project entity, TimeContext context) { entity.Team = await context.Teams.FindAsync(entity.Team.Id); entity.Customer = await context.Customers.FindAsync(entity.Customer.Id); }
public Repository(TimeContext context) { _context = context; dbSet = _context.Set <T>(); }