using LotteryWebApp.Service; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace LotteryWebApp.Components { public class TicketFormModel { public List data { get; set; } public string type { get; set; } } public class TicketForm : ViewComponent { public async Task InvokeAsync(List data, string type) { TicketFormModel model = new TicketFormModel(); model.data = data != null ? data : new List(); model.type = type; return View("TicketForm", model); } } }