Ejemplo n.º 1
0
        public override Lite <Entity> ExecuteUniqueEntity(UniqueEntityRequest request)
        {
            var ex = new _EntityColumn(EntityColumnFactory().BuildColumnDescription(), QueryName);

            DQueryable <T> orderQuery = Query
                                        .ToDQueryable(GetQueryDescription())
                                        .SelectMany(request.Multiplications)
                                        .Where(request.Filters)
                                        .OrderBy(request.Orders);

            var result = orderQuery
                         .SelectOne(ex.Token)
                         .Unique(request.UniqueType);

            return((Lite <Entity>)result);
        }
Ejemplo n.º 2
0
        public override async Task <Lite <Entity>?> ExecuteUniqueEntityAsync(UniqueEntityRequest request, CancellationToken token)
        {
            var ex = new _EntityColumn(EntityColumnFactory().BuildColumnDescription(), QueryName);

            DQueryable <T> orderQuery = Query
                                        .ToDQueryable(GetQueryDescription())
                                        .SelectMany(request.Multiplications)
                                        .Where(request.Filters)
                                        .OrderBy(request.Orders);

            var result = await orderQuery
                         .SelectOne(ex.Token)
                         .UniqueAsync(request.UniqueType, token);

            return((Lite <Entity>?)result);
        }