28 lines
804 B
C#
28 lines
804 B
C#
using Data.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace View.ViewModels
|
|
{
|
|
public class ProductTableItem
|
|
{
|
|
public string Id { get; set; }
|
|
public string Name { get; set; }
|
|
public string ManufacturerName { get; set; }
|
|
public string DeliveryDate { get; set; }
|
|
public static List<ProductTableItem> ConvertProductsToTableItems(List<Product> products)
|
|
{
|
|
return products.Select(p => new ProductTableItem
|
|
{
|
|
Id = p.Id.ToString(),
|
|
Name = p.Name,
|
|
ManufacturerName = p.ManufacturerName,
|
|
DeliveryDate = p.DeliveryDate.ToShortDateString()
|
|
}).ToList();
|
|
}
|
|
}
|
|
}
|