12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace wpf_template.Model
- {
- public class Product
- {
- public string Title { get; set; }
- public string Company { get; set; }
- public int Price { get; set; }
- public string Category { get; set; }
- public string Photo { get; set; }
- }
- interface IDataProvider
- {
- IEnumerable<Product> GetProducts();
- }
- public class LocalDataProvider : IDataProvider
- {
- public IEnumerable<Product> GetProducts()
- {
- return new Product[]{
- new Product
- {
- Category = "Смартфон",
- Company = "Apple",
- Title = "13 Pro Max",
- Price = 84999
- },
- new Product
- {
- Category = "Смартфон",
- Company = "Samsung",
- Title = "S23",
- Price = 89999
- },
- new Product
- {
- Category = "Ноутбук",
- Company = "Xiaomi",
- Title = "RedmiBook 15",
- Price = 49999
- }
- };
- }
- }
- }
|