public override void UpdateLink(Link link) { var context = new MyLifeEntities(); var obj = new tblLinks {Id = link.Id}; context.AttachTo("tblLinks", obj); BizObject<Link, int>.CopyToObject(link, obj); context.SaveChanges(); }
public override void DeleteLink(int id) { var context = new MyLifeEntities(); var obj = new tblLinks {Id = id}; context.AttachTo("tblLinks", obj); context.DeleteObject(obj); context.SaveChanges(); }
public override int InsertLink(Link link) { var context = new MyLifeEntities(); var obj = new tblLinks(); BizObject<Link, int>.CopyToObject(link, obj); context.AddTotblLinks(obj); context.SaveChanges(); return obj.Id; }
private static Link Convert(tblLinks obj) { if (obj == null) { return null; } var link = new Link(obj.Id, obj.CreatedDate, obj.CreatedBy, obj.ModifiedDate, obj.ModifiedBy); BizObject<Link, int>.CopyFromObject(link, obj); return link; }
/// <summary> /// Create a new tblLinks object. /// </summary> /// <param name="id">Initial value of Id.</param> /// <param name="createdDate">Initial value of CreatedDate.</param> /// <param name="createdBy">Initial value of CreatedBy.</param> /// <param name="modifiedDate">Initial value of ModifiedDate.</param> /// <param name="modifiedBy">Initial value of ModifiedBy.</param> /// <param name="title">Initial value of Title.</param> /// <param name="url">Initial value of Url.</param> public static tblLinks CreatetblLinks(int id, global::System.DateTime createdDate, string createdBy, global::System.DateTime modifiedDate, string modifiedBy, string title, string url) { tblLinks tblLinks = new tblLinks(); tblLinks.Id = id; tblLinks.CreatedDate = createdDate; tblLinks.CreatedBy = createdBy; tblLinks.ModifiedDate = modifiedDate; tblLinks.ModifiedBy = modifiedBy; tblLinks.Title = title; tblLinks.Url = url; return tblLinks; }
/// <summary> /// There are no comments for tblLinks in the schema. /// </summary> public void AddTotblLinks(tblLinks tblLinks) { base.AddObject("tblLinks", tblLinks); }