Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerable<ProdPriceDisplay> GetShopProductsPrices()
- {
- //ProdPriceDisplay ProdPrice = new ProdPriceDisplay();
- var Products = from shop in db.SHOPs
- select new ProdPriceDisplay
- {
- ProdPrice = shop.S_NAME + " - £" + shop.S_PRICE
- };
- // *** Want to add something like this:-
- // Products.Add new ProdPriceDisplay { ProdPrice = "some additional text"; }
- return Products;
- }
- public IEnumerable<ProdPriceDisplay> GetShopProductsPrices()
- {
- var products = from shop in db.SHOPs
- select new ProdPriceDisplay
- {
- ProdPrice = shop.S_NAME + " - £" + shop.S_PRICE
- };
- return products.AsEnumerable()
- .Concat(new [] { new ProdPriceDisplay
- { ProdPrice = "some additional text"; });
- }
- var productsAsList = Products.ToList();
- productsAsList.Add(new ProdPriceDisplay { ProdPrice = "some additional text"; });
- return productsAsList; // As your return type is IEnumarable, that won't be a problem;
Add Comment
Please, Sign In to add comment