public UserController(IMapper mapper, IApplicationActor actor, UseCaseExecutor executor) { _context = new ProjekatContext(); this.actor = actor; this.executor = executor; _mapper = mapper; }
public PostController(IMapper mapper, CreatePostValidator validator, ProjekatContext context, UseCaseExecutor executor) { _context = context; _mapper = mapper; _validator = validator; _executor = executor; }
public CreateUserValidation(ProjekatContext context) { RuleFor(x => x.FirstName) .MinimumLength(2) .NotEmpty() .WithMessage("The Field FirstName must not be empty"); RuleFor(x => x.LastName) .MinimumLength(2) .NotEmpty() .WithMessage("The Field LastName must not be empty"); RuleFor(x => x.Email) .NotEmpty() .WithMessage("The Field Email must not be empty") .Must(x => !context.Users.Any(user => user.Email == x)) .WithMessage("Username is alredy taken") .EmailAddress(); RuleFor(x => x.Password) .MinimumLength(2) .NotEmpty() .WithMessage("The Field Password must not be empty"); RuleFor(x => x.Username) .NotEmpty() .WithMessage("The Field Username must not be empty") .Must(x => !context.Users.Any(user => user.Username == x)) .WithMessage("Username is alredy taken"); }
public CreateCategoryValidation(ProjekatContext context) { RuleFor(x => x.Name) .NotEmpty() .Must(x => !context.Categories.Any(c => c.Name == x)) .WithMessage("Name of category must be unique"); }
public ModifyUserValidation(ProjekatContext context) { RuleFor(x => x.FirstName) .NotEmpty() .WithMessage("FirstName is required parametar"); RuleFor(x => x.LastName) .NotEmpty() .WithMessage("LastName is required parametar"); RuleFor(x => x.Email) .NotEmpty() .WithMessage("Email is required parametar") .Must(x => !context.Users.Any(user => user.Email == x)) .WithMessage("Email is alredy taken"); RuleFor(x => x.Password) .NotEmpty() .WithMessage("Email is required parametar"); RuleFor(x => x.Username) .NotEmpty() .WithMessage("Email is required parametar") .Must(x => !context.Users.Any(user => user.Username == x)) .WithMessage("Username is alredy taken"); }
public CreateGroupValidator(ProjekatContext context) { RuleFor(x => x.Name) .NotEmpty() .Must(name => !context.Groups.Any(g => g.Name == name)) .WithMessage("Group name must be unique"); }
public UpdatePhotoValidator(ProjekatContext context) { RuleFor(x => x.Path) .NotEmpty() .WithMessage("Path is required parameter.") .Must((dto, path) => !context.Photos.Any(p => p.Path == path && p.Id != dto.Id)) .WithMessage(p => $"Path already exists in database."); }
public UpdateUserValidator(ProjekatContext context) { RuleFor(x => x.Email) .NotEmpty() .WithMessage("Email is required parameter.") .Must((dto, email) => !context.Users.Any(p => p.Email == email && p.Id != dto.Id)) .WithMessage(p => $"Email with the name of {p.Email} already exists in database."); }
public UpdatePostValidator(ProjekatContext context) { RuleFor(x => x.Name) .NotEmpty() .WithMessage("Name is required parameter.") .Must((dto, name) => !context.Posts.Any(p => p.Name == name && p.Id != dto.Id)) .WithMessage(p => $"Post with the name of {p.Name} already exists in database."); }
public UserController(IAddUserCommand createUser, IGetUsersQuery getUser, IEditUserCommand editUser, IDeleteUserCommand deleteUser, ProjekatContext context) { this.createUser = createUser; this.getUser = getUser; this.editUser = editUser; this.deleteUser = deleteUser; this.context = context; }
public ModifyCategoryValidation(ProjekatContext context) { RuleFor(x => x.Name) .NotEmpty() .WithMessage("Name of category not be empty") .Must(x => !context.Categories.Any(category => category.Name == x)) .WithMessage("Name is alredy taken"); }
public GameController(IAddGameCommand createGame, IGetGamesQuery getGame, IGetSingleGameQuery getSingleGame, IEditGameCommand editGame, IDeleteGameCommand deleteGame, ProjekatContext context) { this.getGame = getGame; this.editGame = editGame; this.createGame = createGame; this.deleteGame = deleteGame; this.getSingleGame = getSingleGame; this.context = context; }
public CreateUserValidator(ProjekatContext context) { _context = context; RuleFor(x => x.Email) .NotEmpty() .WithMessage("Email is required parameter.") .Must(email => !_context.Users.Any(p => p.Email == email)) .WithMessage(p => $"Email with the name of {p.Email} already exists in database."); }
public ModifyCommentValidation(ProjekatContext context) { RuleFor(x => x.TextComment) .NotEmpty() .WithMessage("Text of comment not be empty"); RuleFor(x => x.PostId) .NotNull() .WithMessage("IdPost not be null"); RuleFor(x => x.UserId) .NotNull() .WithMessage("IdUser not be null"); }
public CreatePostValidation(ProjekatContext context) { RuleFor(x => x.Title) .NotEmpty() .MinimumLength(3) .Must(x => !context.Posts.Any(c => c.Title == x)) .WithMessage("Title must be unique"); RuleFor(x => x.Text) .NotEmpty() .MinimumLength(6) .WithMessage("You must not enter less than 6 characters"); }
public CreatePhotoValidator(ProjekatContext context) { _context = context; RuleFor(x => x.Name) .NotEmpty() .WithMessage("Name is required parameter."); RuleFor(x => x.Path) .NotEmpty() .WithMessage("Photo is required parameter.") .Must(path => !_context.Photos.Any(p => p.Path == path)) .WithMessage(p => $"Path with the name of {p.Path} already exists in database."); }
public RegisterUserValidator(ProjekatContext context) { RuleFor(x => x.FirstName).NotEmpty(); RuleFor(x => x.LastName).NotEmpty(); RuleFor(x => x.Password) .NotEmpty() .MinimumLength(6); RuleFor(x => x.Email) .NotEmpty() .EmailAddress() .Must(x => !context.Users.Any(user => user.Email == x)) .WithMessage("Email is already taken."); }
public EfModifyCommentCommand(ProjekatContext context, ModifyCommentValidation validator) { _context = context; _validator = validator; }
public EfRegisterUserCommand(ProjekatContext context, RegisterUserValidator validator, IEmailSender sender) { _context = context; _validator = validator; _sender = sender; }
public EfDeleteConsolecommand(ProjekatContext context) : base(context) { }
public EfCreateRateCommand(ProjekatContext context, IApplicationActor actor) { _context = context; _actor = actor; }
public EfAddGameCommand(ProjekatContext context) : base(context) { }
public EfGetPostQuery(ProjekatContext context) { _context = context; }
public EfGetGamesCommand(ProjekatContext context) : base(context) { }
public DatabaseUseCaseLogger(ProjekatContext context) => _context = context;
public EfDeleteGenreCommand(ProjekatContext context) : base(context) { }
public EfDeleteCommentCommand(ProjekatContext context) { _context = context; }
public EfLogUserCommand(ProjekatContext context) : base(context) { }
public EfDeletePostCommand(ProjekatContext context) { this._context = context; }
public EfGetRentsCommand(ProjekatContext context) : base(context) { }