// 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));
        }
Beispiel #2
0
 public IActionResult Get()
 {
     try
     {
         var companyTypes = _companyTypeRepository.GetAll();
         return(Ok(companyTypes));
     }
     catch (Exception ex)
     {
         Log.Error(ex, $"unhandled exception");
         return(StatusCode(500, ex));
     }
 }
Beispiel #3
0
 public static List <CompanyType> GetAll()
 {
     return(repository.GetAll());
 }
 // GET: CompanyTypes
 public IActionResult Index()
 {
     return(View(companyTypesRepository.GetAll()));
 }