public async void ReturnAnEntityThatExistsInTheRepository()
        {
            _logger.LogInformation("WECOME TO ReturnAnEntityThatExistsInTheRepository!!");
            IEntityBusiness <Employee> employeeBusiness = ServiceProvider.GetService <IEntityBusiness <Employee> >();
            Employee employee = await employeeBusiness.FindEntityById(2);

            Assert.True(employee != null);
        }
示例#2
0
 public CustomersController(
     IEntityBusiness <Customer> customerEntityBusiness,
     IHostingEnvironment hostingEnvironment,
     ILoggerFactory loggerFactory,
     ILogger <CustomersController> logger) : base(loggerFactory)
 {
     _customerEntityBusiness = customerEntityBusiness;
     this.hostingEnvironment = hostingEnvironment;
     _logger = logger;
 }
示例#3
0
        public void ReturnEntitiesWhenPresentInDatabase()
        {
            IEntityBusiness <Customer> cutomerBusiness = ServiceProvider.GetService <IEntityBusiness <Customer> >();
            int?            pageSize    = 10;
            string          sortCol     = "CustomerID";
            string          sortDir     = "ASC";
            string          searchTerms = string.Empty;
            int?            pageNumber  = 1;
            OperationResult result      = cutomerBusiness.ListItems(
                pageNumber, pageSize, sortCol, sortDir, searchTerms);

            Assert.True(result.Success);
            IEnumerable <Customer> list = result.ObjectsDictionary["list"] as IEnumerable <Customer>;

            Assert.True(list.Count() == pageSize);
        }
 public ChinookController(
     IEntityBusiness <Artist> artistEntityBusiness, IHostingEnvironment hostingEnvironment)
 {
     _artistEntityBusiness   = artistEntityBusiness;
     this.hostingEnvironment = hostingEnvironment;
 }
示例#5
0
 public CustomersController(IEntityBusiness <Customer> customerBusiness,
                            ILoggerFactory loggerFactory) : base(loggerFactory)
 {
     _customerBusiness = customerBusiness;
 }
示例#6
0
 public EntityController(ILogger <EntityController> logger, IEntityBusiness entityBusiness)
 {
     this.logger         = logger;
     this.entityBusiness = entityBusiness;
 }
示例#7
0
 public EmployeesController(IEntityBusiness <Employee> employeeBusiness,
                            ILoggerFactory loggerFactory) : base(loggerFactory)
 {
     _employeeBusiness = employeeBusiness;
 }
 public ArtistsController(IEntityBusiness <Artist> artistEntityBusiness)
 {
     _artistEntityBusiness = artistEntityBusiness;
 }