예제 #1
0
        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
            });
        }
    }
예제 #2
0
        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};
        }