public Mat ModifyMat(Mat newMat)
 {
     using (var db = new DatabaseContext())
     {
         db.Entry(newMat).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return (Mat)db.Mats.Find(newMat.MatId);
     }
 }
 public Mat CreateMat(Mat mat)
 {
     using (var db = new DatabaseContext())
     {
         Mat addedMat = (Mat)db.Mats.Add((EntityFramework.Mat)mat);
         db.SaveChanges();
         return addedMat;
     }
 }
 public Mat ModifyMat(Mat newMat)
 {
     return MatAccessor.ModifyMat(newMat);
 }
 public Mat CreateMat(Mat mat)
 {
     return MatAccessor.CreateMat(mat);
 }