public void Delete(T entity) { using (var context = new ProveedoresConnection(_connString)) { context.Set <T>().Remove(entity); context.SaveChanges(); } }
public object Create(T entity, string propName) { using (var context = new ProveedoresConnection(_connString)) { context.Set <T>().Add(entity); context.SaveChanges(); return(entity.GetType().GetProperty(propName).GetValue(entity, null)); } }
public T Get(long Id) { using (var context = new ProveedoresConnection(_connString)) return(context.Set <T>().Find((object)Id)); }