public void DeleteUser(Guid userId) { try { CommandService.DeleteUser(userId); } catch (Exception ex) { Logger.LogError(ex); throw new FaultException(ex.Message); } }
public async Task <IHttpActionResult> DeleteUser([FromUri] Guid id) { try { await CommandService.DeleteUser(id); return(Ok()); } catch (Exception ex) { Logger.LogError(ex); // Can be fine tuned to throw a general exception instead of sending the server exception return(InternalServerError(ex)); } }