public static Relation ToRelation(this RelationConfig config)
 {
     return(config switch
     {
         CollectionRelationConfig collectionConfig => (Relation) new CollectionRelation(
             collectionConfig.CollectionAlias !,
             collectionConfig.RelatedEntityType !,
             collectionConfig.IdProperty !,
             collectionConfig.DisplayProperties !)
         {
             RepositoryParentSelector = collectionConfig.RepositoryParentProperty,
             RelatedElementsGetter = collectionConfig.RelatedElementsGetter
         },
Example #2
0
 internal static RelationSetup ProcessRelation(RelationConfig config)
 {
     return(config switch
     {
         CollectionRelationConfig collectionConfig => (RelationSetup) new CollectionRelationSetup(
             collectionConfig.CollectionAlias,
             collectionConfig.RelatedRepositoryType,
             collectionConfig.RelatedEntityType !,
             collectionConfig.IdProperty !,
             collectionConfig.DisplayProperties !)
         {
             RepositoryParentSelector = collectionConfig.RepositoryParentProperty,
             RelatedElementsGetter = collectionConfig.RelatedElementsGetter
         },
Example #3
0
 public static Relation ToRelation(this RelationConfig config)
 {
     return(config switch
     {
         CollectionRelationConfig collectionConfig => (Relation) new CollectionRelation
         {
             CollectionAlias = collectionConfig.CollectionAlias,
             RelatedEntityType = collectionConfig.RelatedEntityType,
             DisplayProperties = collectionConfig.DisplayProperties,
             IdProperty = collectionConfig.IdProperty,
             RepositoryParentIdProperty = collectionConfig.RepositoryParentIdProperty,
             RelatedElementsGetter = collectionConfig.RelatedElementsGetter
         },
         DataProviderRelationConfig dataProviderConfig => new DataProviderRelation
         {
             DataCollectionType = dataProviderConfig.DataCollectionType
         },
         _ => throw new InvalidOperationException("Invalid RelationConfig")
     });