public async Task <T?> ExecuteScalar <T>(IQueryable source = null) where T : struct
        {
            OeAsyncEnumerator asyncEnumerator = GetAsyncEnumerator(source);

            if (await asyncEnumerator.MoveNextAsync() && asyncEnumerator.Current != null)
            {
                return((T)asyncEnumerator.Current);
            }

            _httpContext.Response.ContentType = null;
            return(null);
        }
Exemple #2
0
        protected async Task <IActionResult> ODataScalar(OeAsyncEnumerator asyncEnumerator)
        {
            if (await asyncEnumerator.MoveNextAsync() && asyncEnumerator.Current != null)
            {
                return new ContentResult()
                       {
                           Content     = asyncEnumerator.Current.ToString(),
                           ContentType = OeRequestHeaders.TextDefault.ContentType
                       }
            }
            ;

            base.HttpContext.Response.ContentType = null;
            return(new EmptyResult());
        }
    }