public EfGenericRepository(ICatalogDbContext context) { if (context == null) { throw new ArgumentException("An instance of DbContext is required to use this repository.", "context"); } this.Context = context.DbContext; this.DbSet = this.Context.Set <T>(); }
public GetTrackListQueryHandler( ICatalogDbContext context, ITrackFilterBuilder filterBuilder, IEntityOrderBuilder <Track> orderBuilder, IMapper mapper) { _context = context ?? throw new ArgumentNullException(nameof(context)); _filterBuilder = filterBuilder ?? throw new ArgumentNullException(nameof(filterBuilder)); _orderBuilder = orderBuilder ?? throw new ArgumentNullException(nameof(orderBuilder)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public static Task Send(string accion, string message, ICatalogDbContext _context, CancellationToken cancellationToken) { _context.Audits.Add(new Audit { Date = DateTime.Now, Action = accion, IsError = true, Message = message }); _context.SaveChangesAsync(cancellationToken); return(Task.CompletedTask); }
public BrandService(ICatalogDbContext catalogDbContext, IModelValidator <Brand> validator) { _catalogDbContext = catalogDbContext; _validator = validator; }
public CatalogSeed(ICatalogDbContext context) { _context = context; }
public ProductService(ICatalogDbContext catalogDbContext, IProductValidator productValidator) { _catalogDbContext = catalogDbContext; _productValidator = productValidator; }
public ProductDeleteCommandHandler(ICatalogDbContext context) { _context = context; }
public RepositoryBase(ICatalogDbContext catalogContext) { _context = catalogContext ?? throw new ArgumentNullException(nameof(catalogContext)); _dbCollection = _context.GetCollection <T>(typeof(T).Name); }
public static IRuleBuilderOptions <T, Guid> ProductExists <T>(this IRuleBuilderInitial <T, Guid> builder, ICatalogDbContext context) { return(builder.MustAsync(async(Guid productId, CancellationToken cancellationToken) => { var product = await context.Products.FindAsync(new object[] { productId }, cancellationToken); return product != null; }).WithErrorCode("ProductNotExists")); }
public UpsertProductCommandHandler(ICatalogDbContext context, IMediator mediator) { _context = context; _mediator = mediator; }
public BrandCommandHandler(ICatalogDbContext context) { _context = context; }
public CreatePlaylistCommandHandler(ICatalogDbContext context, IMapper mapper) { _context = context ?? throw new ArgumentNullException(nameof(context)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public ProductDeleteCommandValidation(ICatalogDbContext context) { RuleFor(x => x.ProductId).ProductExists(context); }
public GetTrackQueryHandler(ICatalogDbContext context, IMapper mapper) { _context = context ?? throw new ArgumentNullException(nameof(context)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public CatalogService(ICatalogDbContext context) { this.context = context; }
public NotFoundException(string name, object key, ICatalogDbContext context, CancellationToken cancellationToken) : base($"Entidad '{name}' ({key}) no fue encontrada.") { ExceptionAudit.Send("", $"Entidad '{name}' ({key}) no fue encontrada.", context, cancellationToken); }
public UpdateTrackCommandHandler(ICatalogDbContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public ProductUpdateCommandValidator(ICatalogDbContext context) { RuleFor(x => x.Name).NotEmpty(); RuleFor(x => x.Description).NotEmpty(); RuleFor(x => x.ProductId).ProductExists(context); }
public SupplierService(ICatalogDbContext catalogDbContext, IModelValidator <Supplier> validator) { _catalogDbContext = catalogDbContext; _validator = validator; }
public BrandQueryHandler(ICatalogDbContext context) { _context = context; }
public DeletePlaylistCommandHandler(ICatalogDbContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public GetProductsListQueryHandler(ICatalogDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public DeletableEntityRepository(ICatalogDbContext context) : base(context) { }
public ProductValidator(ICatalogDbContext catalogDbContext) { _catalogDbContext = catalogDbContext; }
public CategoryRepository(ICatalogDbContext catalogContext) { _context = catalogContext ?? throw new ArgumentNullException(nameof(catalogContext)); }
public ProductRepository(ICatalogDbContext context) { _context = context; }
public RequestLogger(ILogger <TRequest> logger, ICatalogDbContext context) { _logger = logger; _context = context; }
public ProductCreateCommandHandler(ICatalogDbContext context, IEventBusManager eventBusManager, IMapper mapper) { _context = context; _eventBusManager = eventBusManager; _mapper = mapper; }