Esempio n. 1
0
 public static List<ProductDTO> getProducts(int id)
 {
     using (StarterUpEntities db = new StarterUpEntities())
     {
         var result = db.Products.Where(o => o.ProductID == id).ToList();
         return MapEntity(result);
     }
 }
Esempio n. 2
0
 public static List<CategoryDTO> getCategories(int id)
 {
     using (StarterUpEntities db = new StarterUpEntities())
     {
         var result = db.Categories.Where(o => o.CategoryID == id).ToList();
         return MapEntity(result);
     }
 }
Esempio n. 3
0
 public static List<ProductDTO> getAllProducts()
 {
     using (StarterUpEntities db = new StarterUpEntities())
     {
         var result = db.Products.ToList();
         return MapEntity(result);
     }
 }
Esempio n. 4
0
 public static List<CategoryDTO> getAllCategories()
 {
     using (StarterUpEntities db = new StarterUpEntities())
     {
         var result = db.Categories.ToList();
         return MapEntity(result);
     }
 }