public DetailsModel(IContentGatewayFactory dbContextFactory) { this.LazyDbContext = dbContextFactory.ToLazyContentGateway(this); }
public static Lazy <IContentGateway> ToLazyContext(this IContentGatewayFactory factory, PageModel page) => new Lazy <IContentGateway>(() => factory.Create(page.User.Claims.First(claim => claim.Type == ClaimTypes.NameIdentifier).Value));