/// <summary>
 /// Initializes a new instance of the navigation property class
 /// </summary>
 /// <param name="name">name of the navigation property</param>
 /// <param name="typeUsage">TypeUsage object containing the navigation property type and its facets</param>
 /// <exception cref="System.ArgumentNullException">Thrown if name or typeUsage arguments are null</exception>
 /// <exception cref="System.ArgumentException">Thrown if name argument is empty string</exception>
 internal NavigationProperty(string name, TypeUsage typeUsage)
     : base(name, typeUsage)
 {
     EntityUtil.CheckStringArgument(name, "name");
     EntityUtil.GenericCheckArgumentNull(typeUsage, "typeUsage");
     _accessor = new NavigationPropertyAccessor(name);
 }
 internal NavigationProperty(string name, TypeUsage typeUsage)
     : base(name, typeUsage)
 {
     Check.NotEmpty(name, nameof(name));
     Check.NotNull <TypeUsage>(typeUsage, nameof(typeUsage));
     this._accessor = new NavigationPropertyAccessor(name);
 }
Ejemplo n.º 3
0
        // <summary>
        // Initializes a new instance of the navigation property class
        // </summary>
        // <param name="name"> name of the navigation property </param>
        // <param name="typeUsage"> TypeUsage object containing the navigation property type and its facets </param>
        // <exception cref="System.ArgumentNullException">Thrown if name or typeUsage arguments are null</exception>
        // <exception cref="System.ArgumentException">Thrown if name argument is empty string</exception>
        internal NavigationProperty(string name, TypeUsage typeUsage)
            : base(name, typeUsage)
        {
            Check.NotEmpty(name, "name");
            Check.NotNull(typeUsage, "typeUsage");

            _accessor = new NavigationPropertyAccessor(name);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Initializes a new instance of the navigation property class
        /// </summary>
        /// <param name="name"> name of the navigation property </param>
        /// <param name="typeUsage"> TypeUsage object containing the navigation property type and its facets </param>
        /// <exception cref="System.ArgumentNullException">Thrown if name or typeUsage arguments are null</exception>
        /// <exception cref="System.ArgumentException">Thrown if name argument is empty string</exception>
        internal NavigationProperty(string name, TypeUsage typeUsage)
            : base(name, typeUsage)
        {
            Check.NotEmpty(name, "name");
            Check.NotNull(typeUsage, "typeUsage");

            _accessor = new NavigationPropertyAccessor(name);
        }
        // ------------
        // Constructors
        // ------------

        /// <summary>
        ///     Creates a navigation object with the given relationship
        ///     name, role name for the source and role name for the
        ///     destination.
        /// </summary>
        /// <param name="relationshipName"> Canonical-space name of the relationship. </param>
        /// <param name="from"> Name of the role which is the source of the navigation. </param>
        /// <param name="to"> Name of the role which is the destination of the navigation. </param>
        /// <param name="fromAccessor"> The navigation property which is the source of the navigation. </param>
        /// <param name="toAccessor"> The navigation property which is the destination of the navigation. </param>
        internal RelationshipNavigation(
            string relationshipName, string from, string to, NavigationPropertyAccessor fromAccessor, NavigationPropertyAccessor toAccessor)
        {
            Check.NotEmpty(relationshipName, "relationshipName");
            Check.NotEmpty(@from, "from");
            Check.NotEmpty(to, "to");

            _relationshipName = relationshipName;
            _from = from;
            _to = to;

            _fromAccessor = fromAccessor;
            _toAccessor = toAccessor;
        }
        // ------------
        // Constructors
        // ------------

        /// <summary>
        /// Creates a navigation object with the given relationship
        /// name, role name for the source and role name for the
        /// destination.
        /// </summary>
        /// <param name="relationshipName">Canonical-space name of the relationship.</param>
        /// <param name="from">Name of the role which is the source of the navigation.</param>
        /// <param name="to">Name of the role which is the destination of the navigation.</param>
        /// <param name="fromAccessor">The navigation property which is the source of the navigation.</param>
        /// <param name="toAccessor">The navigation property which is the destination of the navigation.</param>
        internal RelationshipNavigation(
            string relationshipName, string from, string to, NavigationPropertyAccessor fromAccessor, NavigationPropertyAccessor toAccessor)
        {
            EntityUtil.CheckStringArgument(relationshipName, "relationshipName");
            EntityUtil.CheckStringArgument(from, "from");
            EntityUtil.CheckStringArgument(to, "to");

            _relationshipName = relationshipName;
            _from = from;
            _to = to;

            _fromAccessor = fromAccessor;
            _toAccessor = toAccessor;
        }
        // <summary>
        // Creates a navigation object with the given relationship
        // name, role name for the source and role name for the
        // destination.
        // </summary>
        // <param name="associationType"> The association type representing the relationship. </param>
        // <param name="from"> Name of the role which is the source of the navigation. </param>
        // <param name="to"> Name of the role which is the destination of the navigation. </param>
        // <param name="fromAccessor"> The navigation property which is the source of the navigation. </param>
        // <param name="toAccessor"> The navigation property which is the destination of the navigation. </param>
        internal RelationshipNavigation(AssociationType associationType, string from, string to,
            NavigationPropertyAccessor fromAccessor, NavigationPropertyAccessor toAccessor)
        {
            DebugCheck.NotNull(associationType);
            DebugCheck.NotEmpty(@from);
            DebugCheck.NotEmpty(to);

            _associationType = associationType;

            _relationshipName = associationType.FullName;
            _from = from;
            _to = to;

            _fromAccessor = fromAccessor;
            _toAccessor = toAccessor;
        }
 internal void InitializeAccessors(NavigationPropertyAccessor fromAccessor, NavigationPropertyAccessor toAccessor)
 {
     _fromAccessor = fromAccessor;
     _toAccessor = toAccessor;
 }