private Uri GetLink(bool queryLink)
{
if (queryLink && this.SelfLink != null)
{
return this.SelfLink;
}
if (this.EditLink != null)
{
return this.EditLink;
}
Debug.Assert(this.State == EntityStates.Added, "the entity must be in added state");
if (!string.IsNullOrEmpty(this.entitySetName))
{
return Util.CreateUri(this.entitySetName, UriKind.Relative);
}
else
{
return Util.CreateUri(this.parentProperty, UriKind.Relative);
}
}