public static ExtensibleData Resolve(ResourceReference @ref, Gx.Gedcomx document) { if (@ref.Resource == null) { return null; } return Resolve(@ref.Resource, document); }
protected internal override void Embed(ExtensibleData conclusion) { var value = (Conclusion)conclusion; this._lang = this._lang == null ? value._lang : this._lang; this._confidence = this._confidence == null ? value._confidence : this._confidence; this._attribution = this._attribution == null ? value._attribution : this._attribution; this._analysis = this._analysis == null ? value._analysis : this._analysis; if (value._notes != null) { this._notes = this._notes == null ? new List <Note>() : this._notes; this._notes.AddRange(value._notes); } if (value._sources != null) { this._sources = this._sources == null ? new List <SourceReference>() : this._sources; this._sources.AddRange(value._sources); } base.Embed(conclusion); }
public void TestCreateDiscussionReference() { var me = tree.ReadCurrentUser(); var contributor = new ResourceReference("https://familysearch.org/platform/users/agents/" + me.User.TreeUserId).SetResourceId(me.User.TreeUserId); var discussion = tree.AddDiscussion(new Discussion() .SetTitle("Test title") .SetDetails("Test details") .SetContributor(contributor) .SetCreated(DateTime.Now)); cleanup.Add(discussion); var person = (FamilyTreePersonState)tree.AddPerson(TestBacking.GetCreateMalePerson()).Get(); cleanup.Add(person); var state = person.AddDiscussionReference(discussion); Assert.DoesNotThrow(() => state.IfSuccessful()); Assert.AreEqual(HttpStatusCode.Created, state.Response.StatusCode); }
/** * Build out this source description with a descriptor ref. * * @param descriptorRef The descriptor ref. * @return this. */ public SourceDescription SetDescriptorRef(ResourceReference descriptorRef) { DescriptorRef = descriptorRef; return this; }
/** * Build out this source description with an analyis. * @param analysis The analysis. * @return this. */ public SourceDescription AddAnalysis(ResourceReference analysis) { Analysis = analysis; return this; }
/** * Build out this relationship with a reference to the child. * * @param child the child. * @return this. */ public ChildAndParentsRelationship SetChild(Person child) { if (child.Id == null) { throw new ArgumentException("Cannot reference child: no id."); } Child = new ResourceReference("#" + child.Id); return this; }
/** * Build out this relationship with a reference to the mother. * * @param mother the mother. * @return this. */ public ChildAndParentsRelationship SetMother(Person mother) { if (mother.Id == null) { throw new ArgumentException("Cannot reference mother: no id."); } Mother = new ResourceReference("#" + mother.Id); return this; }
/** * Build out this relationship with a reference to the father. * * @param father the father. * @return this. */ public ChildAndParentsRelationship SetFather(ResourceReference father) { Father = father; return this; }
protected internal override void Embed(ExtensibleData conclusion) { var value = (Conclusion)conclusion; this._lang = this._lang == null ? value._lang : this._lang; this._confidence = this._confidence == null ? value._confidence : this._confidence; this._attribution = this._attribution == null ? value._attribution : this._attribution; this._analysis = this._analysis == null ? value._analysis : this._analysis; if (value._notes != null) { this._notes = this._notes == null ? new List<Note>() : this._notes; this._notes.AddRange(value._notes); } if (value._sources != null) { this._sources = this._sources == null ? new List<SourceReference>() : this._sources; this._sources.AddRange(value._sources); } base.Embed(conclusion); }
/** * Build this comment by applying a contributor. * * @param contributor The contributor. * @return this. */ public Comment SetContributor(ResourceReference contributor) { Contributor = contributor; return(this); }
/** * Build out this relationship with a reference to person 2. * * @param person2 person 2. * @return this. */ public Relationship SetPerson2(ResourceReference person2) { Person2 = person2; return this; }
/** * Build out this relationship with a reference to person 1. * * @param person1 person 1. * @return this. */ public Relationship SetPerson1(Person person1) { if (person1.Id == null) { throw new ArgumentException("Cannot reference person1: no id."); } Person1 = new ResourceReference("#" + person1.Id); return this; }
/** * Build out this relationship with a reference to person 1. * * @param person1 person 1. * @return this. */ public Relationship SetPerson1(ResourceReference person1) { Person1 = person1; return this; }
/** * Add a reference to the analysis for this conclusion. * * @param analysis The analysis. * @return this. */ public Conclusion SetAnalysis(ResourceReference analysis) { Analysis = analysis; return this; }
/** * Build out this place description with a spacial description. * @param spatialDescription The spatial description. * @return this */ public PlaceDescription SetSpatialDescription(ResourceReference spatialDescription) { SpatialDescription = spatialDescription; return this; }
/** * Build out this place description with a place. * * @param place The reference to the place. * @return this */ public PlaceDescription SetPlace(ResourceReference place) { Place = place; return this; }
/** * Build up this online account with a service homepage. * * @param serviceHomepage The service homepage. * @return this. */ public OnlineAccount SetServiceHomepage(ResourceReference serviceHomepage) { this.ServiceHomepage = serviceHomepage; return(this); }
/** * Add a phone. * * @param phone The phone to add. */ public void AddPhone(ResourceReference phone) { if (this._phones == null) { this._phones = new List<ResourceReference>(); } this._phones.Add(phone); }
/** * Build up this attribution with a contributor. * * @param contributor The contributor. * @return this. */ public Attribution SetContributor(ResourceReference contributor) { this.Contributor = contributor; return(this); }
/** * Build out this relationship with a reference to the mother. * * @param mother the mother. * @return this. */ public ChildAndParentsRelationship SetMother(ResourceReference mother) { Mother = mother; return this; }
/** * Build out this discussion by applying a contributor. * * @param contributor The contributor. * @return this. */ public Discussion SetContributor(ResourceReference contributor) { Contributor = contributor; return this; }
/** * Build out this relationship with a reference to the child. * * @param child the child. * @return this. */ public ChildAndParentsRelationship SetChild(ResourceReference child) { Child = child; return this; }
/** * Build out this source citation with a template. * @param citationTemplate The template. * @return this. */ public SourceCitation SetCitationTemplate(ResourceReference citationTemplate) { CitationTemplate = citationTemplate; return this; }
/** * Build out this source description with a mediator. * * @param mediator The mediator. * @return this. */ public SourceDescription SetMediator(ResourceReference mediator) { Mediator = mediator; return this; }
/** * Build this comment by applying a contributor. * * @param contributor The contributor. * @return this. */ public Comment SetContributor(ResourceReference contributor) { Contributor = contributor; return this; }
/** * Build out this source description with a repository. * * @param repository The repository. * @return this. */ public SourceDescription SetRepository(ResourceReference repository) { Repository = repository; return this; }
/** * Build up this agent with a home page. * @param homepage The home page of the agent. * @return this. */ public Agent SetHomepage(ResourceReference homepage) { this.Homepage = homepage; return this; }
/** * Build up this attribution with a contributor. * * @param contributor The contributor. * @return this. */ public Attribution SetContributor(ResourceReference contributor) { this.Contributor = contributor; return this; }
/** * Build up this agent with a open id. * @param openid The open id of the agent. * @return this. */ public Agent SetOpenid(ResourceReference openid) { this.Openid = openid; return this; }
/** * Build out this source description with a descriptor ref. * * @param descriptorRef The descriptor ref. * @return this. */ public SourceDescription SetDescriptorRef(ResourceReference descriptorRef) { DescriptorRef = descriptorRef; return(this); }
/** * Build up this agent with an email address. * * @param email The email address. * @return this. */ public Agent SetEmail(ResourceReference email) { AddEmail(email); return this; }
/** * Build out this place description with a jurisdiction. * @param jurisdiction The reference to the jurisdiction. * @return this */ public PlaceDescription SetJurisdiction(ResourceReference jurisdiction) { Jurisdiction = jurisdiction; return this; }
/** * Build up this agent with a phone number. * @param phone The phone number. * @return this. */ public Agent SetPhone(ResourceReference phone) { AddPhone(phone); return this; }
/** * Build up this event role with a person. * @param person The person. * @return this. */ public EventRole SetPerson(ResourceReference person) { Person = person; return this; }
/** * Add an email. * * @param email The email. */ public void AddEmail(ResourceReference email) { if (this._emails == null) { this._emails = new List<ResourceReference>(); } this._emails.Add(email); }