public object Delete(DeleteJournal message) { var sw = Stopwatch.StartNew(); using (var db = _connectionFactory.Open()) { var journal = db.SelectByIds <Journal>(new long[] { message.Id }); if (journal == null) { return new HttpResult() { StatusCode = HttpStatusCode.NotFound } } ; try { db.Delete(journal); } catch (Exception) { throw; } } sw.Stop(); return(new JournalResponse { TimeTakenMs = sw.ElapsedMilliseconds }); } }
public object Delete(DeleteJournal message) { var sw = Stopwatch.StartNew(); using (var db = _connectionFactory.Open()) { var journal = db.SelectByIds<Journal>(new long[] {message.Id}); if (journal == null) return new HttpResult() {StatusCode = HttpStatusCode.NotFound}; try { db.Delete(journal); } catch (Exception) { throw; } } sw.Stop(); return new JournalResponse {TimeTakenMs = sw.ElapsedMilliseconds}; }