public virtual TEntity Insert(TEntity entity) { entity.SyncObjectState(ObjectState.Added); DbSet.Attach(entity); Context.SyncObjectState(entity); return(entity); }
public virtual TEntity Insert(TEntity entity, TKey identifier = default) { entity.SyncObjectState(ObjectState.Added); DbSet.Attach(entity); Context.SyncObjectState(entity); return(entity); }
public virtual void Insert(TEntity entity) { entity.SyncObjectState(ObjectState.Added); _dbSet.Attach(entity); _context.SyncObjectState(entity); }