예제 #1
0
        public UnitOfWork(AppDbContext appDbContext)
        {
            _appDbContext = appDbContext;

            Books      = new BookRepository(_appDbContext);
            Categories = new CategoryRepository(_appDbContext);
        }
예제 #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);
        }
예제 #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();
 }
예제 #4
0
 public CategoryService(IcategoryRepository icategoryRepository)
 {
     __repo = icategoryRepository;
 }
 public Categoryservice(IcategoryRepository categoryRepository)
 {
     _categoryRepository = categoryRepository;
 }