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.context = context;
     this.end = end;
     this.role = role;
 }
Example #3
0
        private IEnumerable <CsdlSemanticsAssociationSet> ComputeAssociationSets()
        {
            List <CsdlSemanticsAssociationSet> associationSets = new List <CsdlSemanticsAssociationSet>();

            if (this.entityContainer.Extends != null)
            {
                // Extends is either a CsdlSemanticsEntityContainer or BadEntityContainer.
                CsdlSemanticsEntityContainer csdlExtends = this.Extends as CsdlSemanticsEntityContainer;
                if (csdlExtends != null)
                {
                    foreach (CsdlAssociationSet associationSet in csdlExtends.entityContainer.AssociationSets)
                    {
                        CsdlSemanticsAssociationSet semanticsSet = new CsdlSemanticsAssociationSet(this, associationSet);
                        associationSets.Add(semanticsSet);
                    }
                }
            }

            foreach (CsdlAssociationSet associationSet in this.entityContainer.AssociationSets)
            {
                CsdlSemanticsAssociationSet semanticsSet = new CsdlSemanticsAssociationSet(this, associationSet);
                associationSets.Add(semanticsSet);
            }

            return(associationSets);
        }
        public IEdmEntitySet FindNavigationTarget(IEdmNavigationProperty property)
        {
            IEdmEntitySet entitySet;
            CsdlSemanticsNavigationProperty csdlSemanticsNavigationProperty = property as CsdlSemanticsNavigationProperty;

            if (csdlSemanticsNavigationProperty != null)
            {
                IEnumerator <IEdmEntityContainer> enumerator = this.Model.EntityContainers().GetEnumerator();
                using (enumerator)
                {
                    while (enumerator.MoveNext())
                    {
                        CsdlSemanticsEntityContainer current = (CsdlSemanticsEntityContainer)enumerator.Current;
                        IEnumerable <CsdlSemanticsAssociationSet> csdlSemanticsAssociationSets = current.FindAssociationSets(csdlSemanticsNavigationProperty.Association);
                        if (csdlSemanticsAssociationSets == null)
                        {
                            continue;
                        }
                        IEnumerator <CsdlSemanticsAssociationSet> enumerator1 = csdlSemanticsAssociationSets.GetEnumerator();
                        using (enumerator1)
                        {
                            while (enumerator1.MoveNext())
                            {
                                CsdlSemanticsAssociationSet    csdlSemanticsAssociationSet = enumerator1.Current;
                                CsdlSemanticsAssociationSetEnd end1 = csdlSemanticsAssociationSet.End1 as CsdlSemanticsAssociationSetEnd;
                                CsdlSemanticsAssociationSetEnd end2 = csdlSemanticsAssociationSet.End2 as CsdlSemanticsAssociationSetEnd;
                                if (csdlSemanticsAssociationSet.End1.EntitySet != this || csdlSemanticsNavigationProperty.To != csdlSemanticsAssociationSet.End2.Role)
                                {
                                    if (csdlSemanticsAssociationSet.End2.EntitySet != this || csdlSemanticsNavigationProperty.To != csdlSemanticsAssociationSet.End1.Role)
                                    {
                                        continue;
                                    }
                                    this.Model.SetAssociationSetName(csdlSemanticsAssociationSet.End2.EntitySet, property, csdlSemanticsAssociationSet.Name);
                                    if (end1 != null && end2 != null)
                                    {
                                        this.Model.SetAssociationSetAnnotations(end2.EntitySet, property, csdlSemanticsAssociationSet.DirectValueAnnotations, end2.DirectValueAnnotations, end1.DirectValueAnnotations);
                                    }
                                    entitySet = csdlSemanticsAssociationSet.End1.EntitySet;
                                    return(entitySet);
                                }
                                else
                                {
                                    this.Model.SetAssociationSetName(csdlSemanticsAssociationSet.End1.EntitySet, property, csdlSemanticsAssociationSet.Name);
                                    if (end1 != null && end2 != null)
                                    {
                                        this.Model.SetAssociationSetAnnotations(end1.EntitySet, property, csdlSemanticsAssociationSet.DirectValueAnnotations, end1.DirectValueAnnotations, end2.DirectValueAnnotations);
                                    }
                                    entitySet = csdlSemanticsAssociationSet.End2.EntitySet;
                                    return(entitySet);
                                }
                            }
                        }
                    }
                    return(null);
                }
                return(entitySet);
            }
            return(null);
        }
 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;
 }
		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 IEnumerable <CsdlSemanticsAssociationSet> ComputeAssociationSets()
        {
            List <CsdlSemanticsAssociationSet> csdlSemanticsAssociationSets = new List <CsdlSemanticsAssociationSet>();

            if (this.entityContainer.Extends != null)
            {
                CsdlSemanticsEntityContainer extends = this.Extends as CsdlSemanticsEntityContainer;
                if (extends != null)
                {
                    foreach (CsdlAssociationSet associationSet in extends.entityContainer.AssociationSets)
                    {
                        CsdlSemanticsAssociationSet csdlSemanticsAssociationSet = new CsdlSemanticsAssociationSet(this, associationSet);
                        csdlSemanticsAssociationSets.Add(csdlSemanticsAssociationSet);
                    }
                }
            }
            foreach (CsdlAssociationSet csdlAssociationSet in this.entityContainer.AssociationSets)
            {
                CsdlSemanticsAssociationSet csdlSemanticsAssociationSet1 = new CsdlSemanticsAssociationSet(this, csdlAssociationSet);
                csdlSemanticsAssociationSets.Add(csdlSemanticsAssociationSet1);
            }
            return(csdlSemanticsAssociationSets);
        }
		private IEnumerable<CsdlSemanticsAssociationSet> ComputeAssociationSets()
		{
			List<CsdlSemanticsAssociationSet> csdlSemanticsAssociationSets = new List<CsdlSemanticsAssociationSet>();
			if (this.entityContainer.Extends != null)
			{
				CsdlSemanticsEntityContainer extends = this.Extends as CsdlSemanticsEntityContainer;
				if (extends != null)
				{
					foreach (CsdlAssociationSet associationSet in extends.entityContainer.AssociationSets)
					{
						CsdlSemanticsAssociationSet csdlSemanticsAssociationSet = new CsdlSemanticsAssociationSet(this, associationSet);
						csdlSemanticsAssociationSets.Add(csdlSemanticsAssociationSet);
					}
				}
			}
			foreach (CsdlAssociationSet csdlAssociationSet in this.entityContainer.AssociationSets)
			{
				CsdlSemanticsAssociationSet csdlSemanticsAssociationSet1 = new CsdlSemanticsAssociationSet(this, csdlAssociationSet);
				csdlSemanticsAssociationSets.Add(csdlSemanticsAssociationSet1);
			}
			return csdlSemanticsAssociationSets;
		}
        private IEnumerable<CsdlSemanticsAssociationSet> ComputeAssociationSets()
        {
            List<CsdlSemanticsAssociationSet> associationSets = new List<CsdlSemanticsAssociationSet>();
            if (this.entityContainer.Extends != null)
            {
                // Extends is either a CsdlSemanticsEntityContainer or BadEntityContainer.
                CsdlSemanticsEntityContainer csdlExtends = this.Extends as CsdlSemanticsEntityContainer;
                if (csdlExtends != null)
                {
                    foreach (CsdlAssociationSet associationSet in csdlExtends.entityContainer.AssociationSets)
                    {
                        CsdlSemanticsAssociationSet semanticsSet = new CsdlSemanticsAssociationSet(this, associationSet);
                        associationSets.Add(semanticsSet);
                    }
                }
            }

            foreach (CsdlAssociationSet associationSet in this.entityContainer.AssociationSets)
            {
                CsdlSemanticsAssociationSet semanticsSet = new CsdlSemanticsAssociationSet(this, associationSet);
                associationSets.Add(semanticsSet);
            }

            return associationSets;
        }