|
9 | 9 | using NUnit.Framework; |
10 | 10 | using Xtensive.Core; |
11 | 11 | using Xtensive.Orm.Configuration; |
| 12 | +using Xtensive.Orm.Model; |
12 | 13 | using Xtensive.Orm.Tests.Linq.OfTypeTestModel; |
13 | 14 |
|
| 15 | +#region Model |
| 16 | + |
| 17 | +namespace Xtensive.Orm.Tests.Linq.OfTypeTestModel |
| 18 | +{ |
| 19 | + public interface IBaseEntity : IEntity |
| 20 | + { |
| 21 | + [Field, Key] |
| 22 | + int Id { get; } |
| 23 | + |
| 24 | + [Field] |
| 25 | + long Field1 { get; set; } |
| 26 | + } |
| 27 | + |
| 28 | + public interface IBaseInterface : IEntity |
| 29 | + { |
| 30 | + [Field] |
| 31 | + ulong BaseField { get; set; } |
| 32 | + } |
| 33 | + |
| 34 | + public interface IA |
| 35 | + { |
| 36 | + long Field2 { get; set; } |
| 37 | + } |
| 38 | + |
| 39 | + public interface IB1 : IBaseInterface |
| 40 | + { |
| 41 | + [Field] |
| 42 | + Structure1 Field3 { get; set; } |
| 43 | + |
| 44 | + [Field] |
| 45 | + string Field4 { get; set; } |
| 46 | + } |
| 47 | + |
| 48 | + public interface IC : IBaseInterface |
| 49 | + { |
| 50 | + [Field] |
| 51 | + double Field5 { get; set; } |
| 52 | + |
| 53 | + [Field] |
| 54 | + EntitySet<IB1> Field6 { get; set; } |
| 55 | + } |
| 56 | + |
| 57 | + public interface IB2 : IBaseInterface |
| 58 | + { |
| 59 | + [Field] |
| 60 | + Structure1 Field3 { get; set; } |
| 61 | + |
| 62 | + [Field] |
| 63 | + string Field4 { get; set; } |
| 64 | + } |
| 65 | + |
| 66 | + public class BaseEntity : Entity, IBaseEntity |
| 67 | + { |
| 68 | + public int Id { get; private set; } |
| 69 | + |
| 70 | + public long Field1 { get; set; } |
| 71 | + } |
| 72 | + |
| 73 | + public class Structure1 : Structure |
| 74 | + { |
| 75 | + [Field] |
| 76 | + public int Value1 { get; set; } |
| 77 | + |
| 78 | + [Field] |
| 79 | + public Structure2 Value2 { get; set; } |
| 80 | + |
| 81 | + [Field] |
| 82 | + public string Value3 { get; set; } |
| 83 | + } |
| 84 | + |
| 85 | + public class Structure2 : Structure |
| 86 | + { |
| 87 | + [Field] |
| 88 | + public int Value1 { get; set; } |
| 89 | + |
| 90 | + [Field] |
| 91 | + public DateTime Value2 { get; set; } |
| 92 | + } |
| 93 | + |
| 94 | + public interface IB3ClassTable : IB2 |
| 95 | + { |
| 96 | + } |
| 97 | + |
| 98 | + [HierarchyRoot(InheritanceSchema.ClassTable)] |
| 99 | + public class AClassTable : BaseEntity, IA |
| 100 | + { |
| 101 | + [Field] |
| 102 | + public long Field2 { get; set; } |
| 103 | + } |
| 104 | + |
| 105 | + public class B1ClassTable : AClassTable, IB1 |
| 106 | + { |
| 107 | + public Structure1 Field3 { get; set; } |
| 108 | + |
| 109 | + public ulong BaseField { get; set; } |
| 110 | + |
| 111 | + public string Field4 { get; set; } |
| 112 | + } |
| 113 | + |
| 114 | + public class C1ClassTable : B1ClassTable, IC |
| 115 | + { |
| 116 | + public double Field5 { get; set; } |
| 117 | + |
| 118 | + public EntitySet<IB1> Field6 { get; set; } |
| 119 | + } |
| 120 | + |
| 121 | + public class B2ClassTable : AClassTable, IB1 |
| 122 | + { |
| 123 | + [Field] |
| 124 | + public EntitySet<B2ClassTable> Field5 { get; set; } |
| 125 | + |
| 126 | + public ulong BaseField { get; set; } |
| 127 | + |
| 128 | + public string Field4 { get; set; } |
| 129 | + |
| 130 | + public Structure1 Field3 { get; set; } |
| 131 | + } |
| 132 | + |
| 133 | + public class B3ClassTable : AClassTable, IB3ClassTable |
| 134 | + { |
| 135 | + public ulong BaseField { get; set; } |
| 136 | + |
| 137 | + public Structure1 Field3 { get; set; } |
| 138 | + |
| 139 | + public string Field4 { get; set; } |
| 140 | + } |
| 141 | + |
| 142 | + |
| 143 | + public interface IB3SingleTable : IB2 |
| 144 | + { |
| 145 | + } |
| 146 | + |
| 147 | + [HierarchyRoot(InheritanceSchema.SingleTable)] |
| 148 | + public class ASingleTable : BaseEntity, IA |
| 149 | + { |
| 150 | + [Field] |
| 151 | + public long Field2 { get; set; } |
| 152 | + } |
| 153 | + |
| 154 | + public class B1SingleTable : ASingleTable, IB1 |
| 155 | + { |
| 156 | + public Structure1 Field3 { get; set; } |
| 157 | + |
| 158 | + public ulong BaseField { get; set; } |
| 159 | + |
| 160 | + public string Field4 { get; set; } |
| 161 | + } |
| 162 | + |
| 163 | + public class C1SingleTable : B1SingleTable, IC |
| 164 | + { |
| 165 | + public double Field5 { get; set; } |
| 166 | + |
| 167 | + public EntitySet<IB1> Field6 { get; set; } |
| 168 | + } |
| 169 | + |
| 170 | + public class B2SingleTable : ASingleTable, IB1 |
| 171 | + { |
| 172 | + [Field] |
| 173 | + public EntitySet<B2SingleTable> Field5 { get; set; } |
| 174 | + |
| 175 | + public ulong BaseField { get; set; } |
| 176 | + |
| 177 | + public string Field4 { get; set; } |
| 178 | + |
| 179 | + public Structure1 Field3 { get; set; } |
| 180 | + } |
| 181 | + |
| 182 | + public class B3SingleTable : ASingleTable, IB3SingleTable |
| 183 | + { |
| 184 | + public ulong BaseField { get; set; } |
| 185 | + |
| 186 | + public Structure1 Field3 { get; set; } |
| 187 | + |
| 188 | + public string Field4 { get; set; } |
| 189 | + } |
| 190 | + |
| 191 | + |
| 192 | + public interface IB3ConcreteTable : IB2 |
| 193 | + { |
| 194 | + } |
| 195 | + |
| 196 | + [HierarchyRoot(InheritanceSchema.ConcreteTable)] |
| 197 | + public class AConcreteTable : BaseEntity, IA |
| 198 | + { |
| 199 | + [Field] |
| 200 | + public long Field2 { get; set; } |
| 201 | + } |
| 202 | + |
| 203 | + public class B1ConcreteTable : AConcreteTable, IB1 |
| 204 | + { |
| 205 | + public Structure1 Field3 { get; set; } |
| 206 | + |
| 207 | + public ulong BaseField { get; set; } |
| 208 | + |
| 209 | + public string Field4 { get; set; } |
| 210 | + } |
| 211 | + |
| 212 | + public class C1ConcreteTable : B1ConcreteTable, IC |
| 213 | + { |
| 214 | + public double Field5 { get; set; } |
| 215 | + |
| 216 | + public EntitySet<IB1> Field6 { get; set; } |
| 217 | + } |
| 218 | + |
| 219 | + public class B2ConcreteTable : AConcreteTable, IB1 |
| 220 | + { |
| 221 | + [Field] |
| 222 | + public EntitySet<B2ConcreteTable> Field5 { get; set; } |
| 223 | + |
| 224 | + public ulong BaseField { get; set; } |
| 225 | + |
| 226 | + public string Field4 { get; set; } |
| 227 | + |
| 228 | + public Structure1 Field3 { get; set; } |
| 229 | + } |
| 230 | + |
| 231 | + public class B3ConcreteTable : AConcreteTable, IB3ConcreteTable |
| 232 | + { |
| 233 | + public ulong BaseField { get; set; } |
| 234 | + |
| 235 | + public Structure1 Field3 { get; set; } |
| 236 | + |
| 237 | + public string Field4 { get; set; } |
| 238 | + } |
| 239 | +} |
| 240 | + |
| 241 | +#endregion |
| 242 | + |
14 | 243 | namespace Xtensive.Orm.Tests.Linq |
15 | 244 | { |
16 | 245 | public class OfTypeTest : AutoBuildTest |
|
0 commit comments