예제 #1
0
        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);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public UnitOfWork(TimeContext context)
 {
     _context = context;
 }
예제 #4
0
        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);
        }
예제 #5
0
 private static async Task BuildRelations(Day entity, TimeContext context)
 {
     entity.Employee = await context.People.FindAsync(entity.Employee.Id);
 }
예제 #6
0
        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);
        }
예제 #7
0
 public Repository(TimeContext context)
 {
     _context = context;
     dbSet    = _context.Set <T>();
 }