Esempio n. 1
0
        public UnitOfWork(AppDbContext appDbContext)
        {
            _appDbContext = appDbContext;

            Books      = new BookRepository(_appDbContext);
            Categories = new CategoryRepository(_appDbContext);
        }
Esempio n. 2
0
        public CategoryController(IHttpContextAccessor contextAccessor, IcategoryRepository categoryRepository, IDistributedCache distributedCache)
        {
            string token = contextAccessor.HttpContext.Request.Headers[AttributeConstant.Authorization];

            token = token.Length != 0 ? token.Replace(AttributeConstant.BearerReplace, string.Empty) : string.Empty;
            var    arr     = new JwtSecurityToken(token);
            string orgCode = arr.Claims.ToList()[2].Value;// + AttributeConstant.ConnectionAdd;

            _organizationCode   = orgCode;
            _categoryRepository = categoryRepository;
            _categoryRepository.LoadContext(orgCode, distributedCache);
        }
Esempio n. 3
0
 public GenericService()
 {
     employeeRepository       = new EmployeeRepository();
     aboutRepository          = new AboutRepository();
     producerRepository       = new ProducerRepository();
     categoryRepository       = new CategoryRepository();
     productRepository        = new ProductRepository();
     productDetailsRepository = new ProductDetailsRepository();
     postRepository           = new PostRepository();
     restaurantRepository     = new RestaurantRepository();
     videoRepository          = new VideoRepository();
 }
 public CategoryService(IcategoryRepository icategoryRepository)
 {
     __repo = icategoryRepository;
 }
 public Categoryservice(IcategoryRepository categoryRepository)
 {
     _categoryRepository = categoryRepository;
 }