Example #1
0
 /// <summary>
 /// Copies the property.
 /// </summary>
 /// <param name="prop">The property.</param>
 public void CopyProperty(IManyToManyProperty prop)
 {
     if (prop is null)
     {
         return;
     }
     ManyToManyProperties.Add(prop.Convert <TClassType>(this));
 }
Example #2
0
        /// <summary>
        /// Sets a property as a many to many type.
        /// </summary>
        /// <typeparam name="TDataType">The type of the data type.</typeparam>
        /// <param name="expression">Expression pointing to the property</param>
        /// <returns>The many to many object</returns>
        public ManyToMany <TClassType, TDataType> ManyToMany <TDataType>(System.Linq.Expressions.Expression <Func <TClassType, IList <TDataType> > > expression)
            where TDataType : class
        {
            if (expression is null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            var ReturnValue = new ManyToMany <TClassType, TDataType>(expression, this);

            ManyToManyProperties.Add(ReturnValue);
            return(ReturnValue);
        }