Esempio n. 1
0
        public object Post(CreateJournal message)
        {
            var sw = Stopwatch.StartNew();
            using (var db = _connectionFactory.Open())
            {
                var journal = new Journal
                {
                    Name = message.Name,
                    Description = message.Description,
                    CreatedAt = DateTime.Now
                };

                db.Insert(journal);
            }
            sw.Stop();
            return new JournalResponse {TimeTakenMs = sw.ElapsedMilliseconds};
        }
Esempio n. 2
0
        public object Post(CreateJournal message)
        {
            var sw = Stopwatch.StartNew();

            using (var db = _connectionFactory.Open())
            {
                var journal = new Journal
                {
                    Name        = message.Name,
                    Description = message.Description,
                    CreatedAt   = DateTime.Now
                };

                db.Insert(journal);
            }
            sw.Stop();
            return(new JournalResponse {
                TimeTakenMs = sw.ElapsedMilliseconds
            });
        }