public void Update(Item grid) { CheckGridItem(grid); if (db.Exsist(grid.id)) { db.Update(grid); } }
public void Update(PartialGrid grid) { if (!userDb.GridAllowed(User.Identity.Name, grid.Id)) { throw HttpExceptionFactory.Forbidden(); } if (!ModelState.IsValid) { throw HttpExceptionFactory.InvalidModel(); } if (!db.IsCorrectSlug(grid.Slug, grid.Id)) { throw HttpExceptionFactory.BadSlug(); } if (db.Exsist(grid.Id)) { db.Update(grid); } }