TicketForm.cs 703 B

1234567891011121314151617181920212223242526272829
  1. using LotteryWebApp.Service;
  2. using Microsoft.AspNetCore.Mvc;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. namespace LotteryWebApp.Components
  8. {
  9. public class TicketFormModel
  10. {
  11. public List<Term> data { get; set; }
  12. public string type { get; set; }
  13. }
  14. public class TicketForm : ViewComponent
  15. {
  16. public async Task<IViewComponentResult> InvokeAsync(List<Term> data, string type)
  17. {
  18. TicketFormModel model = new TicketFormModel();
  19. model.data = data != null ? data : new List<Term>();
  20. model.type = type;
  21. return View("TicketForm", model);
  22. }
  23. }
  24. }