public override void DeleteBlogroll(int id) { var context = new BlogsEntities(); var obj = new tblBlogs_Blogrolls {Id = id}; context.AttachTo("tblBlogs_Blogrolls", obj); context.DeleteObject(obj); context.SaveChanges(); }
private static Blogroll Convert(tblBlogs_Blogrolls obj) { if (obj == null) { return null; } var blogroll = new Blogroll(obj.Id, obj.CreatedDate, obj.CreatedBy, obj.ModifiedDate, obj.ModifiedBy); BizObject<Blogroll, int>.CopyFromObject(blogroll, obj); return blogroll; }
public override void UpdateBlogroll(Blogroll blogroll) { var context = new BlogsEntities(); var obj = new tblBlogs_Blogrolls {Id = blogroll.Id}; context.AttachTo("tblBlogs_Blogrolls", obj); BizObject<Blogroll, int>.CopyToObject(blogroll, obj); context.SaveChanges(); }
public override int InsertBlogroll(Blogroll blogroll) { var context = new BlogsEntities(); var obj = new tblBlogs_Blogrolls(); BizObject<Blogroll, int>.CopyToObject(blogroll, obj); context.AddTotblBlogs_Blogrolls(obj); context.SaveChanges(); return obj.Id; }