public IList <T> GetAll() { using (var dbContext = new WorkflowContext()) { var dbSet = dbContext.Set <T>(); return(dbSet.ToList()); } }
public T SaveCommit(T entity) { using (var dbContext = new WorkflowContext()) { var repository = dbContext.Set <T>(); repository.Add(entity); dbContext.SaveChanges(); } return(entity); }
public T Update(T entity) { using (var dbContext = new WorkflowContext()) { var repository = dbContext.Set <T>(); repository.Attach(entity); dbContext.Entry(entity).State = EntityState.Modified; dbContext.SaveChanges(); } return(entity); }
public RepositoryBaseWorkflow(WorkflowContext context) { Db = context; DbSet = Db.Set <TEntity>(); }