Пример #1
0
        public async Task <ActionResult> Delete(int Id)
        {
            var model = companyRepo.GetById(Id);

            Log(model);
            companyRepo.Delete(model);
            companyRepo.SaveChanges();
            return(View(model));
        }
Пример #2
0
        public async Task <IActionResult> Delete([Required] long id)
        {
            if (await _companyRepo.IsCompanyIdExistsAsync(id))
            {
                var companyItem = await _companyRepo.FindCompanyByIdAsync(id);

                await _companyRepo.Delete(companyItem);

                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
        public IActionResult Delete([FromBody] Company DeleteCompany)
        {
            var retval = repo.Delete(DeleteCompany.Id);

            return(StatusCode(StatusCodes.Status200OK, retval));
        }