public ContextProvider(IHttpContextAccessor contextAccessor, IMapper mapper,
                        BusinessBaseProvider businessProvider, ProtDbContext dbContext, DbDialect dbDialect)
 {
     HttpContext      = contextAccessor.HttpContext;
     Mapper           = mapper;
     BusinessProvider = businessProvider;
     DbContext        = dbContext;
     DbDialect        = dbDialect;
     IDAppUser        = HttpContext.Session.GetInt32(CurrentUserIDSessionKey);
 }
Example #2
0
        public BusinessBase(ContextProvider contextProvider, string objectName = "", int dbNumber = 0)
        {
            if (objectName == "")
            {
                objectName = this.ToString().Split('.').Last();
            }

            this.businessProvider = contextProvider.BusinessProvider;
            this.contextProvider  = contextProvider;
            decorator             = businessProvider.GetDecorator(contextProvider, objectName, dbNumber);
            dataItem = Decorator.New(this);
        }
Example #3
0
 public BusinessBase(BusinessBaseProvider businessProvider, bool noDB)
 {
     this.businessProvider = businessProvider;
     decorator             = businessProvider.GetDecorator(null, this.ToString().Split('.').Last(), 0);
     dataItem = Decorator.New(this);
 }
 public async Task StoreAppUser(AppUser user, BusinessBaseProvider provider)
 {
     await provider.StoreObject(user,
                                UseAppUserNoDB? "AppUserNoDB" : "AppUser");
 }
 public BusinessBaseDecorator(BusinessBaseProvider provider)
 {
     this.provider = provider;
 }