public CsdlSemanticsAssociationSetEnd(CsdlSemanticsAssociationSet context, CsdlAssociationSetEnd end, IEdmAssociationEnd role)
     : base(end)
 {
     this.context = context;
     this.end = end;
     this.role = role;
 }
		public CsdlSemanticsAssociationSetEnd(CsdlSemanticsAssociationSet context, CsdlAssociationSetEnd end, IEdmAssociationEnd role) : base(end)
		{
			this.entitySet = new Cache<CsdlSemanticsAssociationSetEnd, IEdmEntitySet>();
			this.errorsCache = new Cache<CsdlSemanticsAssociationSetEnd, IEnumerable<EdmError>>();
			this.context = context;
			this.end = end;
			this.role = role;
		}
		private IEdmAssociationEnd GetRole(CsdlAssociationSetEnd end)
		{
			Func<IEdmAssociationEnd, bool> func = (IEdmAssociationEnd endCandidate) => {
				if (endCandidate == null)
				{
					return false;
				}
				else
				{
					return endCandidate.Name == end.Role;
				}
			}
			;
			if (!func(this.Association.End1))
			{
				if (!func(this.Association.End2))
				{
					return new UnresolvedAssociationEnd(this.Association, end.Role, end.Location);
				}
				else
				{
					return this.Association.End2;
				}
			}
			else
			{
				return this.Association.End1;
			}
		}
Example #4
0
		public CsdlAssociationSet(string name, string association, CsdlAssociationSetEnd end1, CsdlAssociationSetEnd end2, CsdlDocumentation documentation, CsdlLocation location) : base(name, documentation, location)
		{
			this.association = association;
			this.end1 = end1;
			this.end2 = end2;
		}
 private IEdmAssociationEnd GetRole(CsdlAssociationSetEnd end)
 {
     Func<IEdmAssociationEnd, bool> match = (endCandidate) => endCandidate != null && endCandidate.Name == end.Role;
     if (match(this.Association.End1))
     {
         return this.Association.End1;
     }
     else if (match(this.Association.End2))
     {
         return this.Association.End2;
     }
     else
     {
         return new UnresolvedAssociationEnd(this.Association, end.Role, end.Location);
     }
 }