示例#1
0
 public static OkNegotiatedContentResult <TResult> Get <TKey, TEntity, TResult>(
     this CqrsController controller,
     TKey specification)
     where TKey : struct
     where TEntity : class, IEntityBase <TKey>
     where TResult : IEntityBase <TKey>
 => Ok <TKey, TResult, GetQuery <TKey, TEntity, TResult> >(controller, specification);
示例#2
0
 public static OkNegotiatedContentResult <TDto[]> List <TPagedSpecification, TEntity, TDto, TQuery>(
     this CqrsController controller,
     TPagedSpecification specification)
     where TPagedSpecification : IPagedSpecification <TDto>
     where TEntity : class, IEntity
     where TDto : IEntity
     where TQuery : PagedEntityToDtoQuery <TPagedSpecification, TEntity, TDto>
 => Ok <TPagedSpecification, TDto[], TQuery>(controller, specification);
示例#3
0
 public static OkNegotiatedContentResult <TResult> Ok <TSpecification, TResult, TQuery>(
     this CqrsController controller,
     TSpecification specification,
     Func <TSpecification, TQuery, TResult> func)
     where TQuery : IQuery <TSpecification, TResult>
 => new OkNegotiatedContentResult <TResult>(func.Invoke(specification, controller
                                                        .QueryFactory
                                                        .GetQuery <TSpecification, TResult, TQuery>()), controller);
示例#4
0
 public static OkNegotiatedContentResult <TResult> Ok <TSpecification, TResult, TQuery>(
     this CqrsController controller,
     TSpecification specification)
     where TQuery : IQuery <TSpecification, TResult>
 => Ok <TSpecification, TResult, TQuery>(controller, specification, (spec, query) => query.Execute(spec));