Esempio n. 1
0
        public static void Update <TEntity>(this IBcDbContext dbContext, TEntity entity,
                                            params string[] pnames) where TEntity : class
        {
            dbContext.Set <TEntity>().Attach(entity);
            var stateEntry = ((IObjectContextAdapter)dbContext).ObjectContext.
                             ObjectStateManager.GetObjectStateEntry(entity);

            foreach (var pname in pnames)
            {
                stateEntry.SetModifiedProperty(pname);
            }
        }
Esempio n. 2
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext   = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._baseService = BrEngineContext.Current.Resolve <IBrandService>();
 }
Esempio n. 3
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext           = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._parameterSetService = BrEngineContext.Current.Resolve <IParameterSetService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext     = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._acUserService = BrEngineContext.Current.Resolve <IAC_UserService>();
 }
Esempio n. 5
0
 public static void Update <TEntity>(this IBcDbContext dbContext, TEntity entity,
                                     params Expression <Func <TEntity, object> >[] exprs) where TEntity : class
 {
     dbContext.Update(entity, exprs.Select(entity.GetPropertyName).ToArray());
 }
Esempio n. 6
0
 public static void Delete <TEntity>(this IBcDbContext dbContext, TEntity entity) where TEntity : class
 {
     dbContext.Set <TEntity>().Attach(entity);
     dbContext.Set <TEntity>().Remove(entity);
 }
Esempio n. 7
0
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext          = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._userAddressService = BrEngineContext.Current.Resolve <IUserAddressService>();
 }
 public void Init()
 {
     BrEngineContext.Init(null);
     this._dbContext = BrEngineContext.Current.Resolve <IBcDbContext>();
     this._yH_UserBankAccountService = BrEngineContext.Current.Resolve <IYH_UserBankAccountService>();
 }