Пример #1
0
 public int Creat(Solution solution)
 {
     dbContext.Solutions.Add(solution);
     dbContext.SaveChanges();
     int index = 0;
     index = dbContext.Solutions.OrderBy(x => x.Name).ToList().IndexOf(solution);
     return index;
 }
Пример #2
0
 public ActionResult UpdateSolution(Solution solution)
 {
     if (ModelState.IsValid)
     {
         dbContext.Entry(solution).State = EntityState.Modified;
         dbContext.SaveChanges();
         return null;
     }
     else
     {
         return new HttpStatusCodeResult(400, "Custom Error Message 2");
     }
 }