コード例 #1
0
 public static TEntity Find <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, TEntity entity, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions
 => service.Find(service.CreateEqualityComparerExpression(entity),
                 context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                 : DefaultCrudServiceOptions.FromContext <TOptions>(context));
コード例 #2
0
 public static IEnumerable <TEntity> FindAll <TEntity, TOptions>(
     this ICrudService <TEntity, TOptions> service, IEnumerable <TEntity> entities, object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions
 => service.FindAll(service.CreateEqualityComparerExpression(entities),
                    context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                    : DefaultCrudServiceOptions.FromContext <TOptions>(context));
コード例 #3
0
 public static Task <TSelect> FindAsync <TEntity, TOptions, TSelect>(
     this ICrudService <TEntity, TOptions> service, TEntity entity, Expression <Func <TEntity, TSelect> > select,
     object context = null)
     where TEntity : IEntity where TOptions : ICrudServiceOptions
 => Task.Run(() => service.Find(service.CreateEqualityComparerExpression(entity), select,
                                context == null
             ? DefaultCrudServiceOptions.Default <TOptions>()
                                : DefaultCrudServiceOptions.FromContext <TOptions>(context)));