// GET: Admin/CompanyCategories public async Task <IActionResult> Index() { List <CompanyCategory> category = await _context.CompanyCategories.ToListAsync(); List <CompanyCategoryModel> model = new List <CompanyCategoryModel>(); foreach (CompanyCategory item in category) { CompanyCategoryModel copmcatmodel = new CompanyCategoryModel { Id = item.Id, Name = item.Name, CreateDate = item.CreateDate, EndDate = item.EndDate, StartDate = item.StartDate, ParentId = item.ParentId, Published = item.Published }; PrepareCompanyList(copmcatmodel.AvailableCategories, true, "Kategori Seç"); model.Add(copmcatmodel); } return(View(model)); }