public List <StatusModel> GetStatuses() { using (OrderListContext db = new OrderListContext()) { return(db.Statuses.Select(s => new StatusModel { Id = s.Id, Name = s.Name }).ToList()); } }
public List <ProductModel> GetProducts() { using (OrderListContext db = new OrderListContext()) { return(db.Products.Select(p => new ProductModel { Id = p.Id, Name = p.Name, Price = p.Price, PhotoUrl = p.PhotoUrl }).ToList()); } }