public ActionResult Get() { return(Ok(new { Guid = guidService.GetGuid(), SingletonGuid = service.GetGuid() })); }
public IEnumerable <Guid> GetGuidList() { var middlewareGuid = (Guid)HttpContext.Items["guid"]; var guidList = new List <Guid>() { _guidService.GetGuid(), middlewareGuid }; return(guidList); }
public IActionResult OnPost(int restaurantId) { try { var restaurant = restaurantData.Delete(restaurantId); restaurantData.Commit(); if (restaurant == null) { return(RedirectToPage("./NotFound")); } TempData["Message"] = $"{restaurant.Name} deleted !!"; return(RedirectToPage("./List")); } catch (Exception ex) { throw new Exception($"Some error has occuured : {guidService.GetGuid()}"); } }
public async Task Invoke(HttpContext httpContext, IGuidService service) { httpContext.Items["guid"] = service.GetGuid(); await _next(httpContext); }
public SingletonService(IGuidService service) { _guid = service.GetGuid(); }
public IActionResult CtorInterface() { ViewBag.GuidString = _iguidService.GetGuid(); return(View()); }