|
@@ -87,72 +87,6 @@ namespace CD67.FicheCollege.Factory
|
|
|
return query;
|
|
return query;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public virtual void add(ref etablissement entity)
|
|
|
|
|
- {
|
|
|
|
|
- ObjectSet.Add(entity);
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void addMany(ref List<etablissement> entities)
|
|
|
|
|
- {
|
|
|
|
|
- ObjectSet.AddRange(entities);
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void update(ref etablissement entity)
|
|
|
|
|
- {
|
|
|
|
|
- // On attache l'objet en paramètre au contexte, on le note bien comme modifié pour qu'il soit mis à jour
|
|
|
|
|
- ObjectSet.Attach(entity);
|
|
|
|
|
- dbContext.Entry(entity).State = EntityState.Modified;
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void updateMany(ref List<etablissement> entities)
|
|
|
|
|
- {
|
|
|
|
|
- foreach (var item in entities)
|
|
|
|
|
- {
|
|
|
|
|
- // On attache l'objet en paramètre au contexte, on le note bien comme modifié pour qu'il soit mis à jour
|
|
|
|
|
- ObjectSet.Attach(item);
|
|
|
|
|
- dbContext.Entry(item).State = EntityState.Modified;
|
|
|
|
|
- }
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void updateMany(Expression<Func<etablissement, bool>> expression)
|
|
|
|
|
- {
|
|
|
|
|
- List<etablissement> query = ObjectSet.Where(expression).ToList();
|
|
|
|
|
- this.updateMany(ref query);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void updateMany(string dynamicExpression)
|
|
|
|
|
- {
|
|
|
|
|
- List<etablissement> query = ObjectSet.Where(dynamicExpression).ToList();
|
|
|
|
|
- this.updateMany(ref query);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void delete(ref etablissement entity)
|
|
|
|
|
- {
|
|
|
|
|
- ObjectSet.Remove(entity);
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void deleteMany(ref List<etablissement> entities)
|
|
|
|
|
- {
|
|
|
|
|
- ObjectSet.RemoveRange(entities);
|
|
|
|
|
- dbContext.SaveChanges();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void deleteMany(Expression<Func<etablissement, bool>> expression)
|
|
|
|
|
- {
|
|
|
|
|
- List<etablissement> query = ObjectSet.Where(expression).ToList();
|
|
|
|
|
- this.deleteMany(ref query);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public virtual void deleteMany(string dynamicExpression)
|
|
|
|
|
- {
|
|
|
|
|
- List<etablissement> query = ObjectSet.Where(dynamicExpression).ToList();
|
|
|
|
|
- this.deleteMany(ref query);
|
|
|
|
|
- }
|
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
#region Dispose
|
|
#region Dispose
|