/// <summary>
 /// Initializes a new instance of the <see cref="BindingPathConfiguration{TStructuralType}"/> class.
 /// </summary>
 /// <param name="modelBuilder">The model builder.</param>
 /// <param name="structuralType">The type configuration.</param>
 /// <param name="navigationSource">The navigation source configuration.</param>
 public BindingPathConfiguration(ODataModelBuilder modelBuilder,
     StructuralTypeConfiguration<TStructuralType> structuralType,
     NavigationSourceConfiguration navigationSource)
     : this(modelBuilder, structuralType, navigationSource, new List<MemberInfo>())
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrimitivePropertyConfiguration"/> class.
 /// </summary>
 /// <param name="property">The name of the property.</param>
 /// <param name="declaringType">The declaring EDM type of the property.</param>
 public PrimitivePropertyConfiguration(PropertyInfo property, StructuralTypeConfiguration declaringType)
     : base(property, declaringType)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DecimalPropertyConfiguration"/> class.
 /// </summary>
 /// <param name="property">The name of the property.</param>
 /// <param name="declaringType">The declaring EDM type of the property.</param>
 public DecimalPropertyConfiguration(PropertyInfo property, StructuralTypeConfiguration declaringType)
     : base(property, declaringType)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="NavigationPropertyConfiguration"/> class.
        /// </summary>
        /// <param name="property">The backing CLR property.</param>
        /// <param name="multiplicity">The <see cref="EdmMultiplicity"/>.</param>
        /// <param name="declaringType">The declaring structural type.</param>
        public NavigationPropertyConfiguration(PropertyInfo property, EdmMultiplicity multiplicity, StructuralTypeConfiguration declaringType)
            : base(property, declaringType)
        {
            if (property == null)
            {
                throw Error.ArgumentNull("property");
            }

            this.Multiplicity = multiplicity;

            this._relatedType = property.PropertyType;
            if (multiplicity == EdmMultiplicity.Many)
            {
                Type elementType;
                if (!this._relatedType.IsCollection(out elementType))
                {
                    throw Error.Argument("property", SRResources.ManyToManyNavigationPropertyMustReturnCollection, property.Name, property.ReflectedType.Name);
                }

                this._relatedType = elementType;
            }

            this.OnDeleteAction = EdmOnDeleteAction.None;
        }