public IActionResult Delete([FromRoute] int id) { _logger.LogInformation("Delete profile, ID: {id} ", id); var result = _dal.Remove(id); if (result != null) { _logger.LogInformation("Delete is successful"); return(Ok(new ProfileViewModel(result))); } else { string error = "Profile cant be founded on this ID"; _logger.LogInformation(error); return(BadRequest(new { error })); } }