예제 #1
0
        /// <inheritdoc />
        public async Task <ServiceEndpointModel> RetrieveAsync(string key, CancellationToken token = default, bool includeNavigationProperties = false)
        {
            key = ServiceNameNormalizedBuilder
                  .Create(key)
                  .ToString();

            return(await Context.ServiceEndpoints.FirstAsync(e => e.Service.ServiceType == key, token));
        }
예제 #2
0
        /// <inheritdoc />
        public async Task <bool> ContainsAsync(string key, CancellationToken token = default)
        {
            key = ServiceNameNormalizedBuilder
                  .Create(key)
                  .ToString();

            //Check if any match the name.
            return(await Context.ServiceEndpoints.AnyAsync(e => e.Service.ServiceType == key, token));
        }
예제 #3
0
        /// <inheritdoc />
        public async Task <ServiceEndpointModel[]> RetrieveAllAsync(string key, CancellationToken token = default)
        {
            key = ServiceNameNormalizedBuilder
                  .Create(key)
                  .ToString();

            //All services with the service type.
            return(await Context.ServiceEndpoints
                   .Where(e => e.Service.ServiceType == key)
                   .ToArrayAsync(token));
        }