Esempio n. 1
0
 ProductModel IProductService.FindProductByID(Guid ID)
 {
     using (var work = GetUnitOfWork())
     {
         var ProductContext = work.Products.Get(ID);
         return(_mapper.MapFromEntityToModel(ProductContext));
     }
 }
Esempio n. 2
0
 ProductOptionModel IProductOptionService.GetExactOption(Guid productID, Guid optionID)
 {
     using (var work = GetUnitOfWork())
     {
         var optionEntity = work.ProductOptions.SingleOrDefault(opt => (opt.ProductId == productID && opt.Id == optionID));
         return(_mapper.MapFromEntityToModel(optionEntity));
     }
 }