OrderItemViewModel.cs 887 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. namespace DutchTreat.ViewModels
  4. {
  5. public class OrderItemViewModel
  6. {
  7. public int Id { get; set; }
  8. [Required]
  9. public int Quantity { get; set; }
  10. [Required]
  11. public decimal UnitPrice { get; set; }
  12. [Required]
  13. public int ProductId { get; set; }
  14. /// <summary>
  15. /// automapper convention to fetch related product information
  16. /// add Product as the prefix to the property. the mapper automatically
  17. /// maps it
  18. /// </summary>
  19. public string ProductCategory { get; set; }
  20. public string ProductSize { get; set; }
  21. public decimal ProductPrice { get; set; }
  22. public string ProductTitle { get; set; }
  23. public string ProductArtist { get; set; }
  24. public string ProductArtId { get; set; }
  25. }
  26. }