// GET: Companies/Create public IActionResult Create() { List <Company> companies = new List <Company>() { new Company() { CompanyType = new CompanyType() } }; ViewData["CompanyTypeId"] = new SelectList(companyTypeRepository.GetAll(), "Id", "Title"); return(View(companies)); }
public IActionResult Get() { try { var companyTypes = _companyTypeRepository.GetAll(); return(Ok(companyTypes)); } catch (Exception ex) { Log.Error(ex, $"unhandled exception"); return(StatusCode(500, ex)); } }
public static List <CompanyType> GetAll() { return(repository.GetAll()); }
// GET: CompanyTypes public IActionResult Index() { return(View(companyTypesRepository.GetAll())); }