public static ShopProductsDTO GetShopProductsById(long id)
 {
     using (GetCoffeeDBEntities db = new GetCoffeeDBEntities())
     {
         return(ShopProductsConverter.DALToDTO(db.Shop_sProduct.Find(id)));
     }
 }
Beispiel #2
0
        public static ShopProductsDTO Add(ShopProductsDTO shopProducts)
        {
            Shop_sProduct ss = ShopProductsConverter.DTOToDAL(shopProducts);

            using (GetCoffeeDBEntities db = new GetCoffeeDBEntities())
            {
                db.Shop_sProduct.Add(ss);
                db.SaveChanges();
            }
            return(ShopProductsConverter.DALToDTO(ss));
        }