using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using YBDevice.Application; using YBDevice.Entity; namespace YBDevice.NWeb.Pages.Device { public class EditAppModel : BaseModel { public List types = new List(); public YB_DeviceTypeApp data = new YB_DeviceTypeApp(); public List offlist = new List(); public List typelist = new List(); private IDeviceService _deviceService; private IOfficialService _officialService; public EditAppModel(IDeviceService deviceService, IOfficialService officialService) { _deviceService = deviceService; _officialService = officialService; } public async Task OnGetAsync(Guid? id) { types = await _deviceService.GetTypeListAsync(); offlist = await _officialService.GetAllListAsync(2); if (id.HasValue && id.Value != Guid.Empty) { data = await _deviceService.GetDeviceAppAsync(id.Value); typelist = data.DevType.Split(',').ToList(); } } } }