Esempio n. 1
0
        public static IEntityContextServiceCollection <TContext> AddUi <TContext>(this IEntityContextServiceCollection <TContext> services)
            where TContext : EntityContext
        {
            services.Services
            .AddScoped <UiNodeConverter>()
            .AddTransient <IUiQuery, UiQuery>();

            services.Services
            .AddMvcCore()
            .AddApplicationPart(typeof(AspNetCoreDependencyInjectionExtensions).Assembly);

            return(services);
        }
Esempio n. 2
0
        public static IEntityContextServiceCollection <TContext> AddMvcAuthentication <TContext>(this IEntityContextServiceCollection <TContext> services)
            where TContext : EntityContext
        {
            services.Services
            .AddSingleton <IHttpContextAccessor, HttpContextAccessor>()
            .AddScoped <ISecurityContextProvider <TContext>, AspNetCoreSecurityProvider <TContext> >();

            return(services);
        }