Esempio n. 1
0
        public virtual int Delete(TKey key, bool isSave = true)
        {
            TEntity entity = EFContext.Set <TEntity, TKey>().Find(key);

            EFContext.RegisterDeleted <TEntity, TKey>(entity);
            return(isSave ? EFContext.Submit() : 0);
        }
Esempio n. 2
0
 public virtual int Update(Expression <Func <TEntity, object> > expression, TEntity entity, bool isSave = true)
 {
     EFContext.RegisterModified <TEntity, TKey>(expression, entity);
     return(isSave ? EFContext.Submit() : 0);
 }
Esempio n. 3
0
 public virtual int Update(TEntity entity, bool isSave = true)
 {
     EFContext.RegisterModified <TEntity, TKey>(entity);
     return(isSave ? EFContext.Submit() : 0);
 }
Esempio n. 4
0
 public virtual int Delete(IEnumerable <TEntity> entities, bool isSave = true)
 {
     EFContext.RegisterDeleted <TEntity, TKey>(entities);
     return(isSave ? EFContext.Submit() : 0);
 }
Esempio n. 5
0
 public virtual int Insert(TEntity entity, bool isSave = true)
 {
     EFContext.RegisterNew <TEntity, TKey>(entity);
     return(isSave ? EFContext.Submit() : 0);
 }