Example #1
0
 public ItemService(IItemRepository ItemRepository, IItemTagRepository ItemTagRepository,
                    ITagRepository _tagRepository, IUniOfWork unitOfWork)
 {
     this._ItemRepository    = ItemRepository;
     this._ItemTagRepository = ItemTagRepository;
     this._tagRepository     = _tagRepository;
     this._unitOfWork        = unitOfWork;
 }
Example #2
0
 public ApplicationGroupService(IUniOfWork unitOfWork,
                                IApplicationUserGroupRepository appUserGroupRepository,
                                IApplicationGroupRepository appGroupRepository)
 {
     this._appGroupRepository     = appGroupRepository;
     this._appUserGroupRepository = appUserGroupRepository;
     this._unitOfWork             = unitOfWork;
 }
Example #3
0
 public Order Post([FromServices] ICustomerRepository customerRepository,
                   [FromServices] IOrderRepository orderRepository,
                   [FromServices] IUniOfWork unityOfWork)
 {
     try
     {
         var customer = new Customer {
             Name = "Fernando Henrique Leme"
         };
         var order = new Order {
             Number = "123", Customer = customer
         };
         customerRepository.Save(customer);
         orderRepository.Save(order);
         unityOfWork.Commit();
         return(order);
     }
     catch
     {
         unityOfWork.Rollback();
         return(null);
     }
 }
Example #4
0
 //constructor cua Service
 public PostService(IPostRepository postRepository, IUniOfWork unitOfWork)
 {
     this._postRepository = postRepository;
     this._unitOfWork     = unitOfWork;
 }
 public ProductService(IUniOfWork uniOfWork)
 {
     _uniOfWork = uniOfWork;
 }
 public ErrorService(IErrorRepository errorRepository, IUniOfWork unitOfWork)
 {
     this._errorRepository = errorRepository;
     this._UnitOfWork      = unitOfWork;
 }
 public ProductCategoryService(IProductCategoryRepository ProductCategoryRepository, IUniOfWork unitOfWork)
 {
     this._ProductCategoryRepository = ProductCategoryRepository;
     this._unitOfWork = unitOfWork;
 }