예제 #1
0
 public ActionRequestInfo(
     HttpContext httpContext,
     IImplementationsContainer implementationsContainer,
     string entityTypeName,
     ActionTypeEnum actionType,
     string actionName = null)
 {
     ActionType     = actionType;
     ActionName     = actionName;
     EntityTypeName = entityTypeName;
     AppTypeId      = implementationsContainer.InstanceInfo.AppTypeId;
     AppInstanceId  = implementationsContainer.InstanceInfo.AppInstanceId;
     if (!httpContext.User.Identity.IsAuthenticated)
     {
         Roles = _anonymousRoles;
         return;
     }
     if (!Guid.TryParse(httpContext.User.Claims.FirstOrDefault(x => x.Type == "sub")?.Value, out var userId))
     {
         Roles = _anonymousRoles;
         return;
     }
     UserId = userId;
     Roles  = httpContext.User.Claims.Where(x => x.Type == "role").Select(x => x.Value).ToArray();
 }
예제 #2
0
 public EfCoreEntityHandler(
     IImplementationsContainer implementationsContainer,
     EfCoreEntityHandlerInternal handlerInternal)
 {
     _implementationsContainer = implementationsContainer;
     _handlerInternal          = handlerInternal;
 }
예제 #3
0
 public EfCoreEntityHandler(
     IImplementationsContainer implementationsContainer,
     IDataLogImplementation dataLogImplementation,
     EfCoreEntityHandlerInternal handlerInternal)
 {
     _dataLogImplementation    = dataLogImplementation;
     _implementationsContainer = implementationsContainer;
     _handlerInternal          = handlerInternal;
 }
예제 #4
0
 public ManageMetadataController(
     MetadataDbContext dbContext,
     IImplementationsContainer implementations,
     IPermissionService permissionService)
 {
     _dbContext         = dbContext;
     _implementations   = implementations;
     _permissionService = permissionService;
 }
예제 #5
0
 public EfCoreEntityHandlerInternal(
     IImplementationsContainer implementationsContainer,
     IEntityValidator validator,
     EntityHelper entityHelper)
 {
     _implementationsContainer = implementationsContainer;
     _validator    = validator;
     _entityHelper = entityHelper;
 }
예제 #6
0
 public EntityController(
     IEntityHandler entityHandler,
     IImplementationsContainer implementationsContainer,
     IPermissionService permissionService)
 {
     _entityHandler            = entityHandler;
     _implementationsContainer = implementationsContainer;
     _permissionService        = permissionService;
 }
예제 #7
0
 public RequestLogger(
     IImplementationsContainer implementationsContainer,
     IHttpContextAccessor httpContextAccessor,
     ILogger <RequestLogger> logger,
     IGlobalConfiguration globalConfiguration)
 {
     _implementationsContainer = implementationsContainer;
     _dbContext           = _implementationsContainer.GetLobDbContext <LobToolsDbContext>(httpContextAccessor.HttpContext);
     _logger              = logger;
     _globalConfiguration = globalConfiguration;
 }
예제 #8
0
 public EntityController(
     IEntityHandler entityHandler,
     IImplementationsContainer implementationsContainer,
     IPermissionService permissionService,
     IObjectGraphHandler objectGraphHandler)
 {
     _entityHandler            = entityHandler;
     _implementationsContainer = implementationsContainer;
     _permissionService        = permissionService;
     _objectGraphHandler       = objectGraphHandler;
 }
예제 #9
0
 public ReportController(
     IImplementationsContainer implementationsContainer,
     IUsersService usersService,
     IRichTextDocumentHandler richTextDocumentHandler,
     IEntityHandler entityHandler,
     MetadataDbContext metadataDbContext)
 {
     _implementationsContainer = implementationsContainer;
     _usersService             = usersService;
     _richTextDocumentHandler  = richTextDocumentHandler;
     _entityHandler            = entityHandler;
     _metadataDbContext        = metadataDbContext;
 }
예제 #10
0
        public static TLobDbContext GetLobDbContext <TLobDbContext>(this IImplementationsContainer implementationsContainer, HttpContext httpContext)
            where TLobDbContext : DbContext
        {
            if (implementationsContainer == null)
            {
                return(httpContext.RequestServices.GetRequiredService <TLobDbContext>());
            }
            var dbContext = implementationsContainer?.GetLobToolsRepository();

            if (dbContext != null && dbContext is TLobDbContext lobDbContext)
            {
                return(lobDbContext);
            }
            return(httpContext.RequestServices.GetRequiredService <TLobDbContext>());
        }
 public ReleaseMetadataController(
     IWebHostEnvironment hostingEnvironment,
     MetadataDbContext dbContext,
     IBusinessAssemblyGenerator assemblyGenerator,
     IImplementationsContainer implementationContainer,
     IOptions <GlobalConfiguration> globalConfiguration,
     IPermissionService permissionService
     )
 {
     _hostingEnvironment      = hostingEnvironment;
     _dbContext               = dbContext;
     _assemblyGenerator       = assemblyGenerator;
     _implementationContainer = implementationContainer;
     _globalConfiguration     = globalConfiguration.Value;
     _permissionService       = permissionService;
 }
예제 #12
0
 public EfCoreEntityValidator(IImplementationsContainer implementationsContainer)
 {
     _implementationsContainer = implementationsContainer;
 }
 public HeavyOrmObjectGraphHandler(IImplementationsContainer implementations, IEntityHandler entityHandler)
 {
     _implementations = implementations;
     _entityHandler   = entityHandler;
 }
예제 #14
0
 public EntityHelper(IImplementationsContainer implementationsContainer)
 {
     _implementationsContainer = implementationsContainer;
 }
예제 #15
0
 public CommentController(IImplementationsContainer implementationsContainer, IUsersService usersService)
 {
     _implementationsContainer = implementationsContainer;
     _usersService             = usersService;
 }
예제 #16
0
 public static async Task <string> AddEntityTypeValidation(EntityTypeModel model, MetadataDbContext dbContext, IImplementationsContainer implementationsContainer)
 {
     if (await dbContext.EntityTypes.AnyAsync(x => x.Name == model.Name && x.AppTypeId == implementationsContainer.InstanceInfo.AppTypeId))
     {
         return($"Another entity with name: \"{ model.Name }\" is already defiend.");
     }
     return(await Task.FromResult(string.Empty));
 }
예제 #17
0
 public MetadataController(IImplementationsContainer implementationsContainer, IPermissionService permissionService)
 {
     _implementationsContainer = implementationsContainer;
     _permissionService        = permissionService;
 }