PhoneClass.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace wpf_template.Model
  7. {
  8. public class Product
  9. {
  10. public string Title { get; set; }
  11. public string Company { get; set; }
  12. public int Price { get; set; }
  13. public string Category { get; set; }
  14. public string Photo { get; set; }
  15. }
  16. interface IDataProvider
  17. {
  18. IEnumerable<Product> GetProducts();
  19. }
  20. public class LocalDataProvider : IDataProvider
  21. {
  22. public IEnumerable<Product> GetProducts()
  23. {
  24. return new Product[]{
  25. new Product
  26. {
  27. Category = "Смартфон",
  28. Company = "Apple",
  29. Title = "13 Pro Max",
  30. Price = 84999
  31. },
  32. new Product
  33. {
  34. Category = "Смартфон",
  35. Company = "Samsung",
  36. Title = "S23",
  37. Price = 89999
  38. },
  39. new Product
  40. {
  41. Category = "Ноутбук",
  42. Company = "Xiaomi",
  43. Title = "RedmiBook 15",
  44. Price = 49999
  45. }
  46. };
  47. }
  48. }
  49. }