src/Misc/EFTools/EntityDesignModel/ModelHelper.cs
/// <summary>
///     Helper method to find a fragment inside either a Default or an IsTypeOf ETM that maps a C and S entity,
///     and optionally creates one if none exists.
/// </summary>
/// <param name="cpc"></param>
/// <param name="conceptualEntityType">The conceptual side entity</param>
/// <param name="storageEntityType">The storage side entity</param>
/// <param name="createIfNoneFound">If you send true, then a fragment will be created inside an IsTypeOf ETM if no other exists</param>
/// <returns>May return null if you pass false to 'createIfNoneFound'</returns>
Helper method to find a fragment inside either a Default or an IsTypeOf ETM that maps a C and S entity,
and optionally creates one if none exists.
Helper method to find a fragment inside either a Default or an IsTypeOf ETM that maps a C and S entity and optionally creates one if none exists .
internal static MappingFragment FindMappingFragment(
            CommandProcessorContext cpc, EntityType conceptualEntityType, EntityType storageEntityType, bool createIfNoneFound)
        {
            var mappingFragment = FindMappingFragment(cpc, conceptualEntityType, storageEntityType, EntityTypeMappingKind.Default, false);
            if (mappingFragment == null)
            {
                mappingFragment = FindMappingFragment(
                    cpc, conceptualEntityType, storageEntityType, EntityTypeMappingKind.IsTypeOf, createIfNoneFound);
            }
            return mappingFragment;
        }
internal static MappingFragment FindMappingFragment ( CommandProcessorContext cpc , EntityType conceptualEntityType , EntityType storageEntityType , bool createIfNoneFound ) { var mappingFragment = FindMappingFragment ( cpc , conceptualEntityType , storageEntityType , EntityTypeMappingKind . Default , false ) ; if ( mappingFragment == null ) { mappingFragment = FindMappingFragment ( cpc , conceptualEntityType , storageEntityType , EntityTypeMappingKind . IsTypeOf , createIfNoneFound ) ; } return mappingFragment ; }
Helper method to find a fragment inside either a Default or an IsTypeOf ETM that maps a C and S entity,
and optionally creates one if none exists.
Helper method to find a fragment inside either a Default or an IsTypeOf ETM that maps a C and S entity and optionally creates one if none exists .
// first see if we have a Default ETM // if we don't have a default, then find or create an IsTypeOf ETM to put this in
May return null if you pass false to 'createIfNoneFound'
May return null if you pass false to ' createIfNoneFound '
cpc
CommandProcessorContext
None
conceptualEntityType
EntityType
The conceptual side entity
The conceptual side entity
storageEntityType
EntityType
The storage side entity
The storage side entity
createIfNoneFound
bool
If you send true, then a fragment will be created inside an IsTypeOf ETM if no other exists
If you send true then a fragment will be created inside an IsTypeOf ETM if no other exists