Exemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            var companyDto = new CompanyDto
            {
                ID = id
            };

            try
            {
                await companyServices.DeleteAsync(companyDto);
            }
            catch (System.Exception)
            {
                ModelState.AddModelError(string.Empty, "You cannot delete this company yet. Please delete the company's offices first.");

                return(View("Manage"));
            }

            return(View("Manage"));
        }