public DeleteFlowerCommandValidator(OrchideaContext context) { RuleFor(x => x.Id) .Must(id => context.Flowers.Any(f => f.Id == id) && id != default) .WithMessage("Element is not exist.") .NotEmpty() .WithMessage("Id is null or empty."); }
public GetFlowersHandler(OrchideaContext context) : base(context) { }
public DeleteFlowerCommandHandler(OrchideaContext context) : base(context) { }
public BaseCommandHandler(OrchideaContext context) { _context = context; }
protected BaseQueryHandler(OrchideaContext context) => _context = context;