コード例 #1
0
        public SetupDatabaseTest()
        {
            ObjectFactory.Initialize(SimpleInjectorIoCContainer.Prepare(false));

            _customerBusinessLogic    = ObjectFactory.GetInstance <ICustomerBusinessLogic>();
            _transactionBusinessLogic = ObjectFactory.GetInstance <ITransactionBusinessLogic>();
        }
コード例 #2
0
 public InvoiceController(InvoiceBusinessLogic invoiceLogic, DetailLineBusinessLogic detailLogic,
                          CustomerBusinessLogic customerLogic)
 {
     _invoiceLogic  = invoiceLogic;
     _detailLogic   = detailLogic;
     _customerLogic = customerLogic;
 }
コード例 #3
0
 public InvoiceBusinessLogic(UnitOfWork uow, DetailLineBusinessLogic detailLineBusinessLogic,
                             CustomerBusinessLogic customerBusinessLogic, ProductBusinessLogic productBusinessLogic)
 {
     _uow = uow;
     _detailLineBusinessLogic = detailLineBusinessLogic;
     _customerBusinessLogic   = customerBusinessLogic;
     _productBusinessLogic    = productBusinessLogic;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProductBusinessLogic"/> class.
 /// </summary>
 /// /// <param name="dataAccess">ICMN110051DataAccess</param>
 /// /// <param name="dataContext">IDataContext</param>
 public ProductBusinessLogic(IDataContext context, IBaseRepository <Product> repository)
     : base(context)
 {
     _iCust = StartupExtensions.Resolve <ICustomerBusinessLogic>();
 }
 public CustomersController(ICustomerBusinessLogic customerBusinessLogic)
 {
     _customerBusinessLogic = customerBusinessLogic;
 }
コード例 #6
0
 public CustomerController(CustomerBusinessLogic customerLogic, InvoiceBusinessLogic invoiceLogic)
 {
     _customerLogic = customerLogic;
     _invoiceLogic  = invoiceLogic;
 }
コード例 #7
0
        public async Task <IActionResult> Post([FromBody] RegistrationViewModel model, [FromServices] ICustomerBusinessLogic _service)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var userIdentity = _mapper.Map <AppUser>(model);

            var result = await _userManager.CreateAsync(userIdentity, model.Password);

            if (!result.Succeeded)
            {
                return(new BadRequestObjectResult(Errors.AddErrorsToModelState(result, ModelState)));
            }

            await Task.FromResult(_service.InsertCustomer(new Customer {
                IdentityId = userIdentity.Id, Location = model.Location
            }));

            return(new OkObjectResult("Account created"));
        }
コード例 #8
0
 public CustomerController(ICustomerBusinessLogic customerBusinessLogic, ILogger <CustomerController> logger)
 {
     _customeBusinessLogic = customerBusinessLogic;
     _logger = logger;
 }