private static string ToTraceString(this IEdmRowType type)
        {
            StringBuilder stringBuilder = new StringBuilder(EdmTypeKind.Row.ToString());

            stringBuilder.Append('(');
            if (type.Properties().Any <IEdmProperty>())
            {
                IEdmProperty edmProperty = type.Properties().Last <IEdmProperty>();
                foreach (IEdmProperty edmProperty1 in type.Properties())
                {
                    if (edmProperty1 == null)
                    {
                        continue;
                    }
                    stringBuilder.Append(edmProperty1.ToTraceString());
                    if (edmProperty1.Equals(edmProperty))
                    {
                        continue;
                    }
                    stringBuilder.Append(", ");
                }
            }
            stringBuilder.Append(')');
            return(stringBuilder.ToString());
        }
Ejemplo n.º 2
0
        private static bool IsEquivalentTo(this IEdmRowType thisType, IEdmRowType otherType)
        {
            bool flag;

            if (thisType.DeclaredProperties.Count <IEdmProperty>() == otherType.DeclaredProperties.Count <IEdmProperty>())
            {
                IEnumerator <IEdmProperty> enumerator  = thisType.DeclaredProperties.GetEnumerator();
                IEnumerator <IEdmProperty> enumerator1 = otherType.DeclaredProperties.GetEnumerator();
                using (enumerator1)
                {
                    while (enumerator1.MoveNext())
                    {
                        IEdmProperty current = enumerator1.Current;
                        enumerator.MoveNext();
                        if (enumerator.Current.DeclaringType.IsEquivalentTo(current.DeclaringType))
                        {
                            continue;
                        }
                        flag = false;
                        return(flag);
                    }
                    return(true);
                }
                return(flag);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        private static bool IsEquivalentTo(this IEdmRowType thisType, IEdmRowType otherType)
        {
            if (thisType.DeclaredProperties.Count() != otherType.DeclaredProperties.Count())
            {
                return(false);
            }

            IEnumerator <IEdmProperty> thisTypePropertyEnumerator = thisType.DeclaredProperties.GetEnumerator();

            foreach (IEdmProperty otherTypeProperty in otherType.DeclaredProperties)
            {
                thisTypePropertyEnumerator.MoveNext();
                if (!((IEdmStructuralProperty)thisTypePropertyEnumerator.Current).IsEquivalentTo((IEdmStructuralProperty)otherTypeProperty))
                {
                    return(false);
                }
            }

            return(true);
        }
        private static string ToTraceString(this IEdmRowType type)
        {
            StringBuilder sb = new StringBuilder(EdmTypeKind.Row.ToString());

            sb.Append('(');
            if (type.Properties().Any())
            {
                IEdmProperty lastProperty = type.Properties().Last();
                foreach (IEdmProperty prop in type.Properties())
                {
                    if (prop != null)
                    {
                        sb.Append(prop.ToTraceString());
                        if (!prop.Equals(lastProperty))
                        {
                            sb.Append(", ");
                        }
                    }
                }
            }

            sb.Append(')');
            return(sb.ToString());
        }
Ejemplo n.º 5
0
 public static IEdmRowTypeReference ApplyType(this IEdmRowType rowType, bool isNullable)
 {
     EdmUtil.CheckArgumentNull <IEdmRowType>(rowType, "type");
     return(new EdmRowTypeReference(rowType, isNullable));
 }
Ejemplo n.º 6
0
 protected override void ProcessRowType(IEdmRowType element)
 {
     this.schemaWriter.WriteRowTypeElementHeader();
     base.ProcessRowType(element);
     this.schemaWriter.WriteEndElement();
 }
Ejemplo n.º 7
0
		public EdmRowTypeReference(IEdmRowType rowType, bool isNullable) : base(rowType, isNullable)
		{
		}
Ejemplo n.º 8
0
 protected virtual void ProcessRowType(IEdmRowType definition)
 {
     this.ProcessElement(definition);
     this.ProcessStructuredType(definition);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EdmRowTypeReference"/> class.
 /// </summary>
 /// <param name="rowType">Type that describes this value.</param>
 /// <param name="isNullable">Denotes whether the type can be nullable.</param>
 public EdmRowTypeReference(IEdmRowType rowType, bool isNullable)
     : base(rowType, isNullable)
 {
 }
Ejemplo n.º 10
0
        private static bool IsEquivalentTo(this IEdmRowType thisType, IEdmRowType otherType)
        {
            if (thisType.DeclaredProperties.Count() != otherType.DeclaredProperties.Count())
            {
                return false;
            }

            IEnumerator<IEdmProperty> thisTypePropertyEnumerator = thisType.DeclaredProperties.GetEnumerator();
            foreach (IEdmProperty otherTypeProperty in otherType.DeclaredProperties)
            {
                thisTypePropertyEnumerator.MoveNext();
                if (!((IEdmStructuralProperty)thisTypePropertyEnumerator.Current).IsEquivalentTo((IEdmStructuralProperty)otherTypeProperty))
                {
                    return false;
                }
            }

            return true;
        }
Ejemplo n.º 11
0
		private static bool IsEquivalentTo(this IEdmRowType thisType, IEdmRowType otherType)
		{
			bool flag;
			if (thisType.DeclaredProperties.Count<IEdmProperty>() == otherType.DeclaredProperties.Count<IEdmProperty>())
			{
				IEnumerator<IEdmProperty> enumerator = thisType.DeclaredProperties.GetEnumerator();
				IEnumerator<IEdmProperty> enumerator1 = otherType.DeclaredProperties.GetEnumerator();
				using (enumerator1)
				{
					while (enumerator1.MoveNext())
					{
						IEdmProperty current = enumerator1.Current;
						enumerator.MoveNext();
						if (enumerator.Current.DeclaringType.IsEquivalentTo(current.DeclaringType))
						{
							continue;
						}
						flag = false;
						return flag;
					}
					return true;
				}
				return flag;
			}
			else
			{
				return false;
			}
		}