mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Optimize view of company descriptions admin page.
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Cicm.Database.Models;
|
||||
using cicm_web.Areas.Admin.Models;
|
||||
using Markdig;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -58,7 +59,11 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
{
|
||||
IIncludableQueryable<CompanyDescription, Company> cicmContext =
|
||||
_context.CompanyDescriptions.Include(c => c.Company);
|
||||
return View(await cicmContext.OrderBy(c => c.Company.Name).ToListAsync());
|
||||
return View(await cicmContext.OrderBy(c => c.Company.Name)
|
||||
.Select(c => new CompanyDescriptionViewModel
|
||||
{
|
||||
Id = c.Id, Company = c.Company.Name
|
||||
}).ToListAsync());
|
||||
}
|
||||
|
||||
// GET: CompanyDescription/Details/5
|
||||
|
||||
Reference in New Issue
Block a user