public override void UpdateBlog(Blog blog)
 {
     var context = new BlogsEntities();
     var obj = new tblBlogs_Blogs {Id = blog.Id};
     context.AttachTo("tblBlogs_Blogs", obj);
     blog.CopyToObject(obj);
     context.SaveChanges();
 }
        private static Blog Convert(tblBlogs_Blogs obj)
        {
            if (obj == null)
            {
                return null;
            }

            var blog = new Blog(obj.Id, obj.CreatedDate, obj.CreatedBy, obj.ModifiedDate, obj.ModifiedBy);
            BizObject<Blog, int>.CopyFromObject(blog, obj);
            return blog;
        }
 public override int InsertBlog(Blog blog)
 {
     var context = new BlogsEntities();
     var obj = new tblBlogs_Blogs();
     BizObject<Blog, int>.CopyToObject(blog, obj);
     context.AddTotblBlogs_Blogs(obj);
     context.SaveChanges();
     return obj.Id;
 }