public IActionResult LogDetail(Guid logid) { LogDetailModel model = new LogDetailModel(); model.LogDetail = _logService.FindById(logid); return(DynamicResult(model)); }
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); }
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)); }
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)); }