Example #1
0
 public Environment EditEnvironment(Environment environment)
 {
     using (var db = new DataContext())
     {
         db.Entry(environment).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
         db.SaveChanges();
         return(environment);
     }
 }
Example #2
0
 public Environment AddEnvironment(Environment environment)
 {
     using (var db = new DataContext())
     {
         db.Environments.Add(environment);
         db.SaveChanges();
         return(environment);
     }
 }