示例#1
0
 public bool createAbout(about about)
 {
     try
     {
         db.abouts.Add(about);
         db.SaveChanges();
         return(true);
     }catch (Exception e)
     {
         return(false);
     }
 }
示例#2
0
 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);
     }
 }