/// <summary> /// Gets the domains and display them. /// </summary> public async Task OnGetAsync() { List <DisplayDomainModel> domainModels = new List <DisplayDomainModel>(); DomainData domainData = new DomainData(_db); List <DataDomainModel> dataAccessDomainModels = await domainData.GetDomains(); foreach (DataDomainModel dataAccessDomainModel in dataAccessDomainModels) { domainModels.Add(new DisplayDomainModel { Domain = dataAccessDomainModel.Domain, Id = dataAccessDomainModel.Id, }); } Domains = domainModels; }
/// <summary> /// Get all domains. /// </summary> private async Task <List <DisplayDomainModel> > GetDomains() { DomainData domainData = new DomainData(_db); List <DisplayDomainModel> domainModels = new List <DisplayDomainModel>(); List <DataDomainModel> dataDomainModels = await domainData.GetDomains(); foreach (var dataDomainModel in dataDomainModels) { domainModels.Add(new DisplayDomainModel { Domain = dataDomainModel.Domain, Id = dataDomainModel.Id, }); } return(domainModels); }