public void LoadRelationships(CFAPContext ctx) { LoadUserGroupsFromDatabase(ctx); if (this.IsAccountable == true || this.AccountableId != null) { ctx.Configuration.ProxyCreationEnabled = false; this.Accountable = (from a in ctx.Accountables where a.Id == this.AccountableId select a).Single(); } }
public void SetRelationships(CFAPContext ctx) { LoadUserGroupsFromObject(ctx); if (this.IsAccountable == false || this.Accountable == null) { this.AccountableId = null; this.Accountable = null; } else { ctx.Accountables.Attach(this.Accountable); this.AccountableId = this.Accountable.Id; } }
public override bool Equals(object obj) { bool result = false; Accountable otherProject = obj as Accountable; if (otherProject == null) { return(false); } result = this.Id == otherProject.Id; return(result); }