Beispiel #1
0
 public DBMigrator(TaskBudConfig config, TaskBudDbContext dbContext, UserManager <IdentityUser> userManager, RoleManager <IdentityRole> roleManager)
 {
     Config      = config ?? throw new ArgumentNullException(nameof(config));
     DbContext   = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     UserManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
     RoleManager = roleManager ?? throw new ArgumentNullException(nameof(roleManager));
 }
Beispiel #2
0
        public async Task WriteAsync(TaskBudDbContext dbContext, TaskItem model)
        {
            model.Title       = Title;
            model.Description = Description;
            model.Priority    = Priority;
            model.Group       = await dbContext.TaskGroups.FindAsync(TaskGroupId);

            model.AssignedUserId = AssignedUserId;
        }
Beispiel #3
0
 public static Expression <Func <TaskGroup, VMTaskGroup> > Read(TaskBudDbContext db)
 {
     return
         ((model) =>
          new VMTaskGroup
     {
         Id = model.Id,
         Title = model.Title
     });
 }
 public InvitationManager(
     ILogger <InvitationManager> log,
     TaskBudConfig config,
     TaskBudDbContext dbContext,
     UserManager <IdentityUser> userManager)
 {
     Log         = log ?? throw new ArgumentNullException(nameof(log));
     Config      = config ?? throw new ArgumentNullException(nameof(config));
     DbContext   = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     UserManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
Beispiel #5
0
 public static Expression <Func <InvitationCode, VMInvitation> > Read(TaskBudDbContext db)
 {
     return
         ((code) =>
          new VMInvitation
     {
         Id = code.Id,
         State =
             code.UserId != null ? InvitationState.Accepted :
             code.Expiration == null ? InvitationState.Pending :
             code.Expiration.Value < DateTimeOffset.Now ? InvitationState.Expired :
             InvitationState.Pending
     });
 }
Beispiel #6
0
 public static Expression <Func <TaskItem, VMTask> > Read(TaskBudDbContext dbContext)
 {
     return(model => new VMTask
     {
         Id = model.Id,
         Title = model.Title,
         Description = model.Description,
         Priority = model.Priority,
         CreationDate = model.CreationDate,
         CompletionDate = model.CompletionDate,
         AssignedUser = model.AssignedUser != null ? model.AssignedUser.UserName : null,
         AssignedUserId = model.AssignedUserId,
         CreatedBy = model.Creator.UserName,
         TaskGroupId = model.Group.Id
     });
 }
Beispiel #7
0
 public TaskGroupManager(TaskBudDbContext dbContext)
 {
     DBContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
 }
Beispiel #8
0
 public TaskManager(TaskBudDbContext dbContext, UserManager <IdentityUser> userManager)
 {
     DBContext   = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
     UserManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
Beispiel #9
0
 public void Write(TaskBudDbContext dbContext, TaskGroup model)
 {
     model.Title = Title;
 }