public EditPostLikeCommandHandler( ICurrentUser currentUser, IPostDomainRepository postRepository) { this.currentUser = currentUser; this.postRepository = postRepository; }
public CreateCarAdCommandHandler( ICurrentUser currentUser, IPostDomainRepository postRepository, IPublicUserDomainRepository publicUserRepository) { this.currentUser = currentUser; this.postRepository = postRepository; this.publicUserRepository = publicUserRepository; }
public DeletePostCommandHandler( ICurrentUser currentUser, IPostDomainRepository postRepository, IPublicUserDomainRepository userRepository) { this.currentUser = currentUser; this.postRepository = postRepository; this.userRepository = userRepository; }
public PostCommandValidator(IPostDomainRepository postRepository) { this.RuleFor(c => c.Description) .MinimumLength(MinDescriptionLength) .MaximumLength(MaxDescriptionLength) .NotEmpty(); this.RuleFor(c => c.Category) .MustAsync(async(category, token) => await postRepository .GetCategory(category, token) != null) .WithMessage("'{PropertyName}' does not exist."); //this.RuleFor(c => c.ImageUrl) // .Must(url => Uri.IsWellFormedUriString(url, UriKind.Absolute)) // .WithMessage("'{PropertyName}' must be a valid url."); }
public CreatePostCommandValidator(IPostDomainRepository postRepository) => this.Include(new PostCommandValidator <CreatePostCommand>(postRepository));