public EfCreateGroupCommand(
     DDDTContext context,
     CreateGroupValidator validator)
 {
     _context   = context;
     _validator = validator;
 }
 public CreateGroupValidator(DDDTContext context)
 {
     RuleFor(x => x.Name)
     .NotEmpty()
     .Must(name => !context.Groups.Any(g => g.Name == name))
     .WithMessage("Group name must be unique");
 }
        public RegisterUserValidator(DDDTContext context)
        {
            RuleFor(x => x.FirstName).NotEmpty();
            RuleFor(x => x.LastName).NotEmpty();
            RuleFor(x => x.Password)
            .NotEmpty()
            .MinimumLength(6);

            RuleFor(x => x.Username)
            .NotEmpty()
            .MinimumLength(4)
            .Must(x => !context.Users.Any(user => user.Username == x))
            .WithMessage("Username is already taken.");

            RuleFor(x => x.Email)
            .NotEmpty()
            .EmailAddress()
            .Must(x => !context.Users.Any(user => user.Email == x))
            .WithMessage("User with that email allready exist");
        }
 public EfDeleteGroupCommand(DDDTContext context)
 {
     _context = context;
 }
 public JwtManager(DDDTContext context)
 {
     _context = context;
 }
 public EfGetGroupsQuery(DDDTContext context)
 {
     _context = context;
 }
예제 #7
0
 public RegisterUserCommand(DDDTContext context)
 {
     _context = context;
 }