コード例 #1
0
            private async Task <ProductCategory> DetermineNewCategory(
                PoTrackerDbContext context,
                Domain.Models.SupplierAggregate.Supplier supplier,
                ProductCategory modelCategory, int?commandCategoryId)
            {
                if (modelCategory != null && commandCategoryId == null)
                {
                    return(null);
                }

                if ((modelCategory == null && commandCategoryId != null) ||
                    (modelCategory != null && modelCategory.Id != commandCategoryId))
                {
                    return(await context.Entry(supplier).Collection(s => s.ProductCategories).Query()
                           .Where(c => c.Id == commandCategoryId).SingleAsync());
                }

                return(null);
            }
コード例 #2
0
 public Handler(PoTrackerDbContext context)
 {
     _context = context;
 }
 public Handler(PoTrackerDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
コード例 #4
0
 public Handler(PoTrackerDbContext context, IConfigurationProvider configuration, IMapper mapper)
 {
     _context       = context;
     _configuration = configuration;
     _mapper        = mapper;
 }
 public Handler(PoTrackerDbContext context, IMapper mapper, IMediator mediator)
 {
     _context  = context;
     _mapper   = mapper;
     _mediator = mediator;
 }