|
| 1 | +//Adapted from Microsoft.AspNet.OData.Test.Query.Expressions |
| 2 | +using Microsoft.AspNet.OData.Query; |
| 3 | +using Microsoft.OData.Edm; |
| 4 | +using System; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.Linq; |
| 7 | +using System.Xml.Linq; |
| 8 | + |
| 9 | +namespace AutoMapper.OData.EF6.Tests.Data |
| 10 | +{ |
| 11 | + public class Product |
| 12 | + { |
| 13 | + public int ProductID { get; set; } |
| 14 | + |
| 15 | + public string ProductName { get; set; } |
| 16 | + public int SupplierID { get; set; } |
| 17 | + public int CategoryID { get; set; } |
| 18 | + public string QuantityPerUnit { get; set; } |
| 19 | + public decimal? UnitPrice { get; set; } |
| 20 | + public double? Weight { get; set; } |
| 21 | + public float? Width { get; set; } |
| 22 | + public short? UnitsInStock { get; set; } |
| 23 | + public short? UnitsOnOrder { get; set; } |
| 24 | + |
| 25 | + public short? ReorderLevel { get; set; } |
| 26 | + public bool? Discontinued { get; set; } |
| 27 | + public DateTimeOffset? DiscontinuedDate { get; set; } |
| 28 | + public System.DateTime Birthday { get; set; } |
| 29 | + |
| 30 | + public DateTimeOffset NonNullableDiscontinuedDate { get; set; } |
| 31 | + [NotFilterable] |
| 32 | + public DateTimeOffset NotFilterableDiscontinuedDate { get; set; } |
| 33 | + |
| 34 | + public DateTimeOffset DiscontinuedOffset { get; set; } |
| 35 | + public TimeSpan DiscontinuedSince { get; set; } |
| 36 | + |
| 37 | + public Date DateProperty { get; set; } |
| 38 | + public Date? NullableDateProperty { get; set; } |
| 39 | + |
| 40 | + public Guid GuidProperty { get; set; } |
| 41 | + public Guid? NullableGuidProperty { get; set; } |
| 42 | + |
| 43 | + public TimeOfDay TimeOfDayProperty { get; set; } |
| 44 | + public TimeOfDay? NullableTimeOfDayProperty { get; set; } |
| 45 | + |
| 46 | + public ushort? UnsignedReorderLevel { get; set; } |
| 47 | + |
| 48 | + public SimpleEnum Ranking { get; set; } |
| 49 | + |
| 50 | + public Category Category { get; set; } |
| 51 | + |
| 52 | + public Address SupplierAddress { get; set; } |
| 53 | + |
| 54 | + public int[] AlternateIDs { get; set; } |
| 55 | + public Address[] AlternateAddresses { get; set; } |
| 56 | + [NotFilterable] |
| 57 | + public Address[] NotFilterableAlternateAddresses { get; set; } |
| 58 | + } |
| 59 | + |
| 60 | + public class Category |
| 61 | + { |
| 62 | + public int CategoryID { get; set; } |
| 63 | + public string CategoryName { get; set; } |
| 64 | + |
| 65 | + public Product Product { get; set; } |
| 66 | + |
| 67 | + public ICollection<Product> Products { get; set; } |
| 68 | + |
| 69 | + public IEnumerable<Product> EnumerableProducts { get; set; } |
| 70 | + public IQueryable<Product> QueryableProducts { get; set; } |
| 71 | + } |
| 72 | + |
| 73 | + public class Address |
| 74 | + { |
| 75 | + public int AddressID { get; set; } |
| 76 | + public string City { get; set; } |
| 77 | + public string State { get; set; } |
| 78 | + public string ZipCode { get; set; } |
| 79 | + } |
| 80 | + |
| 81 | + public class DataTypes |
| 82 | + { |
| 83 | + public int Id { get; set; } |
| 84 | + public Guid GuidProp { get; set; } |
| 85 | + public DateTimeOffset DateTimeProp { get; set; } |
| 86 | + public DateTimeOffset DateTimeOffsetProp { get; set; } |
| 87 | + public byte[] ByteArrayProp { get; set; } |
| 88 | + public byte[] ByteArrayPropWithNullValue { get; set; } |
| 89 | + public TimeSpan TimeSpanProp { get; set; } |
| 90 | + public decimal DecimalProp { get; set; } |
| 91 | + public double DoubleProp { get; set; } |
| 92 | + public float FloatProp { get; set; } |
| 93 | + public Single SingleProp { get; set; } |
| 94 | + public long LongProp { get; set; } |
| 95 | + public int IntProp { get; set; } |
| 96 | + public string StringProp { get; set; } |
| 97 | + public bool BoolProp { get; set; } |
| 98 | + |
| 99 | + public ushort UShortProp { get; set; } |
| 100 | + public uint UIntProp { get; set; } |
| 101 | + public ulong ULongProp { get; set; } |
| 102 | + public char CharProp { get; set; } |
| 103 | + public byte ByteProp { get; set; } |
| 104 | + |
| 105 | + public short? NullableShortProp { get; set; } |
| 106 | + public int? NullableIntProp { get; set; } |
| 107 | + public long? NullableLongProp { get; set; } |
| 108 | + public Single? NullableSingleProp { get; set; } |
| 109 | + public double? NullableDoubleProp { get; set; } |
| 110 | + public decimal? NullableDecimalProp { get; set; } |
| 111 | + public bool? NullableBoolProp { get; set; } |
| 112 | + public byte? NullableByteProp { get; set; } |
| 113 | + public Guid? NullableGuidProp { get; set; } |
| 114 | + public DateTimeOffset? NullableDateTimeOffsetProp { get; set; } |
| 115 | + public TimeSpan? NullableTimeSpanProp { get; set; } |
| 116 | + |
| 117 | + public ushort? NullableUShortProp { get; set; } |
| 118 | + public uint? NullableUIntProp { get; set; } |
| 119 | + public ulong? NullableULongProp { get; set; } |
| 120 | + public char? NullableCharProp { get; set; } |
| 121 | + |
| 122 | + public char[] CharArrayProp { get; set; } |
| 123 | + public XElement XElementProp { get; set; } |
| 124 | + |
| 125 | + public SimpleEnum SimpleEnumProp { get; set; } |
| 126 | + public FlagsEnum FlagsEnumProp { get; set; } |
| 127 | + public LongEnum LongEnumProp { get; set; } |
| 128 | + public SimpleEnum? NullableSimpleEnumProp { get; set; } |
| 129 | + |
| 130 | + public Product EntityProp { get; set; } |
| 131 | + public Address ComplexProp { get; set; } |
| 132 | + |
| 133 | + public string Inaccessible() { return string.Empty; } |
| 134 | + } |
| 135 | + |
| 136 | + public class DerivedProduct : Product |
| 137 | + { |
| 138 | + public string DerivedProductName { get; set; } |
| 139 | + } |
| 140 | + |
| 141 | + public class DerivedCategory : Category |
| 142 | + { |
| 143 | + public string DerivedCategoryName { get; set; } |
| 144 | + } |
| 145 | + |
| 146 | + public class DynamicProduct : Product |
| 147 | + { |
| 148 | + public Dictionary<string, object> ProductProperties { get; set; } |
| 149 | + } |
| 150 | + |
| 151 | + [Flags] |
| 152 | + public enum FlagsEnum |
| 153 | + { |
| 154 | + One = 0x1, |
| 155 | + Two = 0x2, |
| 156 | + Four = 0x4 |
| 157 | + } |
| 158 | + |
| 159 | + public enum SimpleEnum |
| 160 | + { |
| 161 | + First, |
| 162 | + Second, |
| 163 | + Third, |
| 164 | + Fourth |
| 165 | + } |
| 166 | + |
| 167 | + public enum LongEnum : long |
| 168 | + { |
| 169 | + FirstLong, |
| 170 | + SecondLong, |
| 171 | + ThirdLong, |
| 172 | + FourthLong |
| 173 | + } |
| 174 | +} |
0 commit comments