// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Mvc; using XmlFormattersWebSite.Models; namespace XmlFormattersWebSite.Controllers { public class IQueryableController : Controller { public IQueryable ValueTypes() { return Enumerable.Range(1, 2).Select(i => i * 10).AsQueryable(); } public IQueryable NonWrappedTypes() { return Enumerable.Range(1, 2).Select(i => "value" + i).AsQueryable(); } public IQueryable WrappedTypes() { return new[] { new Person() { Id = 10, Name = "Mike" }, new Person() { Id = 11, Name = "Jimmy" } }.AsQueryable(); } public IQueryable WrappedTypes_Empty() { return (new Person[] { }).AsQueryable(); } public IQueryable NonWrappedTypes_Empty() { return (new string[] { }).AsQueryable(); } public IQueryable NonWrappedTypes_NullInstance() { return null; } public IQueryable WrappedTypes_NullInstance() { return null; } } }