Example #1
0
        public void Unregister(int agentId)
        {
            var agentEntity = _agentRepository.GetAll().Where(x => x.AgentId == agentId).FirstOrDefault();

            if (agentEntity != null)
            {
                _agentRepository.DeleteAsync(agentEntity);
            }
        }
        public async Task <ActionResult> Delete(int id)
        {
            logger.Info($"Action Start | Controller name: {nameof(AgentsController)} | Action name: {nameof(Delete)} | Input params: {nameof(id)}={id}");
            await repository.DeleteAsync(id);

            await repository.SaveAsync();

            return(RedirectToAction("Index"));
        }
Example #3
0
        public async Task <IActionResult> Delete(int id)
        {
            if (id <= 0)
            {
                return(BadRequest());
            }

            await _implementation.DeleteAsync(id);

            return(Ok());
        }