using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace MvcExample.Models | |
{ | |
public static class ProductRepository | |
{ | |
public static List<Product> GetProducts() | |
{ | |
return new List<Product>() | |
{ | |
new Product() | |
{ | |
Name = "Product 1", | |
Price = 5.01F, | |
Stock = 12 | |
}, | |
new Product() | |
{ | |
Name = "Product 2", | |
Price = 12.89F, | |
Stock = 23 | |
}, | |
new Product() | |
{ | |
Name = "Product 3", | |
Price = 14.89F, | |
Stock = 68 | |
} | |
}; | |
} | |
} | |
public class Product | |
{ | |
public string Name { get; set; } | |
public float Price { get; set; } | |
public int Stock { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment