public bool Modify(Blog model) { IBlogRepository iBlogRepos = IoCContext.Container.Resolve<IBlogRepository>(); Blog oldModel = iBlogRepos.GetSingle(m => m.blogId == model.blogId); oldModel.Content = model.Content; return iBlogRepos.Update(model, false) > 0; }
/// <summary> /// Create a new Blog object. /// </summary> /// <param name="blogId">Initial value of the blogId property.</param> public static Blog CreateBlog(global::System.Int32 blogId) { Blog blog = new Blog(); blog.blogId = blogId; return blog; }
/// <summary> /// Deprecated Method for adding a new object to the Blogs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlogs(Blog blog) { base.AddObject("Blogs", blog); }