public bool createAbout(about about) { try { db.abouts.Add(about); db.SaveChanges(); return(true); }catch (Exception e) { return(false); } }
public bool updateAboutById(int id, about update) { try { var currentAbout = this.getAboutById(id); if (currentAbout != null) { currentAbout.content = update.content; db.Entry(currentAbout).State = EntityState.Modified; db.SaveChanges(); return(true); } return(false); }catch (Exception e) { return(false); } }