Esempio n. 1
0
 public void Insert(TEntity entity)
 {
     using (var Context = new SolrQueryExplainContext())
     {
         Context.Set <TEntity>().Add(entity);
         Context.SaveChanges();
     }
 }
Esempio n. 2
0
 public void Update(TEntity entity)
 {
     using (var Context = new SolrQueryExplainContext())
     {
         Context.Set <TEntity>().Attach(entity);
         Context.Entry(entity).State = EntityState.Modified;
         Context.SaveChanges();
     }
 }
Esempio n. 3
0
 public void Delete(TEntity entity)
 {
     using (var Context = new SolrQueryExplainContext())
     {
         if (Context.Entry(entity).State == EntityState.Detached)
         {
             Context.Set <TEntity>().Attach(entity);
         }
         Context.Set <TEntity>().Remove(entity);
         Context.SaveChanges();
     }
 }