コード例 #1
0
 public void UpdateLog(Guid id, string userInput)
 {
     using (PersonalWebsiteContext context = new PersonalWebsiteContext())
     {
         Log error = context.LoggedMessages.Find(id);
         error.UserInput = userInput;
         context.SaveChanges();
     }
 }
コード例 #2
0
        /// <summary>
        /// Saves a new blog to the db.  Post cannot be null.
        /// </summary>
        /// <param name="post">The post to save, cannot be null.</param>
        public void Log(Log log)
        {
            if (log == null)
                throw new ArgumentNullException("error");

            using (PersonalWebsiteContext context = new PersonalWebsiteContext())
            {
                context.LoggedMessages.Add(log);
                context.SaveChanges();
            }
        }