Exemplo n.º 1
0
        public IQueryable GetCustomers()
        {
            var customers = new InheritanceQueryable_Customer[]
            {
                new InheritanceQueryable_Customer
                {
                    Vehicles = new Collection <Vehicle>(new Vehicle[]
                    {
                        new Motorcycle()
                        {
                            CanDoAWheelie = true,
                            Id            = 1,
                            Model         = "abc",
                            Name          = "xxx"
                        },
                        new MiniSportBike()
                        {
                            CanDoAWheelie = false,
                            Id            = 2,
                            Model         = "def",
                            Name          = "zzz",
                            TopSpeed      = 30
                        }
                    }),
                    Vehicle = new Car
                    {
                        Model           = "abc",
                        SeatingCapacity = 4
                    }
                },
                new InheritanceQueryable_Customer
                {
                    Vehicles = new Collection <Vehicle>(new Vehicle[]
                    {
                        new Motorcycle()
                        {
                            CanDoAWheelie = true,
                            Id            = 1,
                            Model         = "abc",
                            Name          = "xxx"
                        },
                        new MiniSportBike()
                        {
                            CanDoAWheelie = false,
                            Id            = 2,
                            Model         = "def",
                            Name          = "zzz",
                            TopSpeed      = 30
                        }
                    }),
                    Vehicle = new Car
                    {
                        Model           = "abc",
                        SeatingCapacity = 4
                    }
                }
            };

            return(customers.AsQueryable());
        }
        public IQueryable GetCustomers()
        {
            var customers = new InheritanceQueryable_Customer[] 
            { 
                new InheritanceQueryable_Customer 
                {
                    Vehicles = new Collection<Vehicle>(new Vehicle[]
                    {
                        new Motorcycle()
                        {
                            CanDoAWheelie = true,
                            Id = 1,
                            Model = "abc",
                            Name = "xxx"
                        },
                        new MiniSportBike()
                        {
                            CanDoAWheelie = false,
                            Id = 2,
                            Model = "def",
                            Name = "zzz",
                            TopSpeed = 30
                        }
                    }),
                    Vehicle = new Car
                    {
                        Model = "abc",
                        SeatingCapacity = 4
                    }
                },
                new InheritanceQueryable_Customer 
                {
                    Vehicles = new Collection<Vehicle>(new Vehicle[]
                    {
                        new Motorcycle()
                        {
                            CanDoAWheelie = true,
                            Id = 1,
                            Model = "abc",
                            Name = "xxx"
                        },
                        new MiniSportBike()
                        {
                            CanDoAWheelie = false,
                            Id = 2,
                            Model = "def",
                            Name = "zzz",
                            TopSpeed = 30
                        }
                    }),
                    Vehicle = new Car
                    {
                        Model = "abc",
                        SeatingCapacity = 4
                    }
                }
            };

            return customers.AsQueryable();
        }