Ejemplo n.º 1
0
 public UserController(IMapper mapper, IApplicationActor actor, UseCaseExecutor executor)
 {
     _context      = new ProjekatContext();
     this.actor    = actor;
     this.executor = executor;
     _mapper       = mapper;
 }
Ejemplo n.º 2
0
 public PostController(IMapper mapper, CreatePostValidator validator, ProjekatContext context, UseCaseExecutor executor)
 {
     _context   = context;
     _mapper    = mapper;
     _validator = validator;
     _executor  = executor;
 }
Ejemplo n.º 3
0
        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");
 }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
 public CreateGroupValidator(ProjekatContext context)
 {
     RuleFor(x => x.Name)
     .NotEmpty()
     .Must(name => !context.Groups.Any(g => g.Name == name))
     .WithMessage("Group name must be unique");
 }
Ejemplo n.º 7
0
 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.");
 }
Ejemplo n.º 8
0
 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.");
 }
Ejemplo n.º 9
0
 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.");
 }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 11
0
 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");
 }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
        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.");
        }
Ejemplo n.º 14
0
 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");
 }
Ejemplo n.º 15
0
        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");
        }
Ejemplo n.º 16
0
        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.");
        }
Ejemplo n.º 17
0
        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.");
        }
Ejemplo n.º 18
0
 public EfModifyCommentCommand(ProjekatContext context, ModifyCommentValidation validator)
 {
     _context   = context;
     _validator = validator;
 }
Ejemplo n.º 19
0
 public EfRegisterUserCommand(ProjekatContext context, RegisterUserValidator validator, IEmailSender sender)
 {
     _context   = context;
     _validator = validator;
     _sender    = sender;
 }
 public EfDeleteConsolecommand(ProjekatContext context) : base(context)
 {
 }
Ejemplo n.º 21
0
 public EfCreateRateCommand(ProjekatContext context, IApplicationActor actor)
 {
     _context = context;
     _actor   = actor;
 }
Ejemplo n.º 22
0
 public EfAddGameCommand(ProjekatContext context) : base(context)
 {
 }
Ejemplo n.º 23
0
 public EfGetPostQuery(ProjekatContext context)
 {
     _context = context;
 }
Ejemplo n.º 24
0
 public EfGetGamesCommand(ProjekatContext context) : base(context)
 {
 }
Ejemplo n.º 25
0
 public DatabaseUseCaseLogger(ProjekatContext context) => _context = context;
Ejemplo n.º 26
0
 public EfDeleteGenreCommand(ProjekatContext context) : base(context)
 {
 }
Ejemplo n.º 27
0
 public EfDeleteCommentCommand(ProjekatContext context)
 {
     _context = context;
 }
Ejemplo n.º 28
0
 public EfLogUserCommand(ProjekatContext context) : base(context)
 {
 }
Ejemplo n.º 29
0
 public EfDeletePostCommand(ProjekatContext context)
 {
     this._context = context;
 }
Ejemplo n.º 30
0
 public EfGetRentsCommand(ProjekatContext context) : base(context)
 {
 }