コード例 #1
0
        private async Task LoadOneToManyCollection <TProperty>(
            [NotNull] Expression <Func <IEnumerable <TProperty> > > navigationPath)
            where TProperty : BaseEntity
        {
            Type thisType             = GetType();
            Type propertyType         = typeof(TProperty);
            var  foreignKeyProperties = propertyType.GetForeignKeyProperties(thisType);
            var  foreignKeyMap        = TypeExtension.GetForeignKeyPropertyValuePairs(foreignKeyProperties, this);
            var  lambda = ExpressionExtensions.LambdaConditionExpression <TProperty>(foreignKeyMap);
            var  result = await QueryBuilder.Select <TProperty>()
                          .Where(lambda)
                          .ExecuteQueryAsync();

            SetValueUsingNavigationPath(navigationPath, result);
        }