public static TBuilder SelectUsing <TRequest, TEntity, TBuilder>(
     this CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder> config,
     Expression <Func <TRequest, TEntity, bool> > selector)
     where TEntity : class
     where TBuilder : CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder>
 {
     return(config.SelectWith(builder => builder.Single(selector)));
 }
 public static TBuilder SelectUsing <TRequest, TEntity, TBuilder, TKey>(
     this CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder> config,
     Expression <Func <TRequest, IEnumerable <TKey> > > requestEnumerableExpr,
     Expression <Func <TEntity, TKey> > entityKeyExpr)
     where TEntity : class
     where TBuilder : CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder>
 {
     return(config.SelectWith(builder => builder.Collection(requestEnumerableExpr, entityKeyExpr)));
 }
示例#3
0
        public static TBuilder BulkCreateWith <TRequest, TEntity, TBuilder>(
            this CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder> builder,
            Func <BulkInsertConfiguration <TEntity>, BulkInsertConfiguration <TEntity> > configure)
            where TEntity : class
            where TBuilder : CrudRequestEntityConfigBuilderCommon <TRequest, TEntity, TBuilder>
        {
            var config = configure(new BulkInsertConfiguration <TEntity>());

            if (config != null)
            {
                BulkConfigurationManager.SetConfiguration(BulkConfigurationType.Insert, typeof(TRequest), typeof(TEntity), config);
            }

            return((TBuilder)builder);
        }