/// <summary> /// Copies the property. /// </summary> /// <param name="prop">The property.</param> public void CopyProperty(IManyToOneProperty prop) { if (prop is null) { return; } ManyToOneProperties.Add(prop.Convert <TClassType>(this)); }
/// <summary> /// Sets a property as a many to one 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 ManyToOneSingle <TClassType, TDataType> ManyToOne <TDataType>(System.Linq.Expressions.Expression <Func <TClassType, TDataType> > expression) where TDataType : class { if (expression is null) { throw new ArgumentNullException(nameof(expression)); } var ReturnValue = new ManyToOneSingle <TClassType, TDataType>(expression, this); ManyToOneProperties.Add(ReturnValue); return(ReturnValue); }