src/Inflatable/ClassMapper/Default/Map.cs
/// <summary>
/// Sets up the property (used internally)
/// </summary>
/// <param name="mappings"></param>
Sets up the property (used internally)
Sets up the property ( used internally )
public override void Setup(IMappingSource mappings)
        {
            ForeignMapping = mappings.GetChildMappings<DataType>()
                                     .SelectMany(x => mappings.GetParentMapping(x.ObjectType))
                                     .Where(x => x.IDProperties.Count > 0)
                                     .Distinct()
                                     .ToList();
            if (ForeignMapping is null)
            {
                throw new ArgumentException($"Foreign key IDs could not be found for {typeof(ClassType).Name}.{Name}");
            }
            var ParentMappings = mappings.GetChildMappings(ParentMapping.ObjectType).SelectMany(x => mappings.GetParentMapping(x.ObjectType)).Distinct();
            SetNullOnDelete = !OnDeleteDoNothingValue && ForeignMapping.Any(x => !ParentMappings.Contains(x));
        }
public override void Setup ( IMappingSource mappings ) { ForeignMapping = mappings . GetChildMappings < DataType > ( ) . SelectMany ( x => mappings . GetParentMapping ( x . ObjectType ) ) . Where ( x => x . IDProperties . Count > 0 ) . Distinct ( ) . ToList ( ) ; if ( ForeignMapping is null ) { throw new ArgumentException ( $" Foreign key IDs could not be found for  { typeof ( ClassType ) . Name } . { Name } " ) ; } var ParentMappings = mappings . GetChildMappings ( ParentMapping . ObjectType ) . SelectMany ( x => mappings . GetParentMapping ( x . ObjectType ) ) . Distinct ( ) ; SetNullOnDelete = ! OnDeleteDoNothingValue && ForeignMapping . Any ( x => ! ParentMappings . Contains ( x ) ) ; }
Sets up the property (used internally)
Sets up the property ( used internally )
mappings
IMappingSource
None