Example #1
0
        public IActionResult LogDetail(Guid logid)
        {
            LogDetailModel model = new LogDetailModel();

            model.LogDetail = _logService.FindById(logid);

            return(DynamicResult(model));
        }
Example #2
0
        public async Task<ActionResult> Detail(int id)
        {
            var model = new LogDetailModel { LogDatabaseName = GetSelectedConnectionStringName().ToFriendlyLogDatabaseName() };

            using (MiniProfiler.Current.Step("Getting log details from database"))
            using (var conn = CreateProfiledDbConnection())
            {
                model.Log = (
                    await conn
                        .QueryAsync<Log>(DapperQueries.GetLog, new { Id = id })
                    )
                    .SingleOrDefault();
            }

            if (model.Log == null)
            {
                return HttpNotFound();
            }

            return View(model);
        }
Example #3
0
        public ActionResult Detail(int id)
        {
            var model = new LogDetailModel {
                LogDatabaseName = GetSelectedConnectionStringName().ToFriendlyLogDatabaseName()
            };
            var profiler = MiniProfiler.Current;

            using (profiler.Step("Getting log details from database"))
                using (var sqlConn = CreateProfiledDbConnection())
                {
                    model.Log = sqlConn
                                .Query <Log>("SELECT * FROM Log WHERE Id = @Id", new { Id = id })
                                .SingleOrDefault();
                }

            if (model.Log == null)
            {
                return(HttpNotFound());
            }

            return(View(model));
        }
Example #4
0
        public async Task <ActionResult> Detail(int id)
        {
            var model = new LogDetailModel {
                LogDatabaseName = GetSelectedConnectionStringName().ToFriendlyLogDatabaseName()
            };

            using (MiniProfiler.Current.Step("Getting log details from database"))
                using (var conn = CreateProfiledDbConnection())
                {
                    model.Log = (
                        await conn
                        .QueryAsync <Log>(DapperQueries.GetLog, new { Id = id })
                        )
                                .SingleOrDefault();
                }

            if (model.Log == null)
            {
                return(HttpNotFound());
            }

            return(View(model));
        }