0
|
1 //---------------------------------------------------------------------------------------------------
|
|
2 // This code was generated by BLToolkit.
|
|
3 //---------------------------------------------------------------------------------------------------
|
|
4 using System;
|
|
5 using System.Linq.Expressions;
|
|
6 /*
|
|
7 using NUnit.Framework;
|
|
8
|
|
9 namespace LightStation.API
|
|
10 {
|
|
11 public interface IStationObjectID
|
|
12 {
|
|
13 }
|
|
14 }
|
|
15
|
|
16 namespace LightStation.API
|
|
17 {
|
|
18 [System.SerializableAttribute()]
|
|
19 public class MachineIdentifier : LightStation.API.StationObject, LightStation.Utils.Validation.IValidatable
|
|
20 {
|
|
21 public LightStation.API.StationObjectID OrganizationId { get; set; }
|
|
22
|
|
23 public string Value { get; set; }
|
|
24
|
|
25 public LightStation.API.StationObjectID SymbolId { get; set; }
|
|
26 }
|
|
27 }
|
|
28
|
|
29 namespace LightStation.API
|
|
30 {
|
|
31 [System.SerializableAttribute()]
|
|
32 public struct NullableStationObjectID : ValueType, LightStation.API.IStationObjectID
|
|
33 {
|
|
34 public NullableStationObjectID(Nullable<int> value)
|
|
35 {
|
|
36 }
|
|
37
|
|
38 public Nullable<int> Value { get; set; }
|
|
39 }
|
|
40 }
|
|
41
|
|
42 namespace LightStation.API
|
|
43 {
|
|
44 [System.SerializableAttribute()]
|
|
45 public abstract class StationObject : LightStation.Utils.Validation.IValidatable
|
|
46 {
|
|
47 public LightStation.API.StationObjectID Id { get; set; }
|
|
48 }
|
|
49 }
|
|
50
|
|
51 namespace LightStation.API
|
|
52 {
|
|
53 [System.SerializableAttribute()]
|
|
54 public struct StationObjectID : ValueType, LightStation.API.IStationObjectID
|
|
55 {
|
|
56 public StationObjectID(int value)
|
|
57 {
|
|
58 }
|
|
59
|
|
60 public int Value { get; set; }
|
|
61 }
|
|
62 }
|
|
63
|
|
64 namespace LightStation.API
|
|
65 {
|
|
66 [System.SerializableAttribute()]
|
|
67 public class Symbol : LightStation.API.StationObject, LightStation.Utils.Validation.IValidatable
|
|
68 {
|
|
69 public string UniqueId { get; set; }
|
|
70
|
|
71 public string TypeName { get; set; }
|
|
72
|
|
73 public bool IsActive { get; set; }
|
|
74
|
|
75 public DateTime StartDate { get; set; }
|
|
76
|
|
77 public Nullable<DateTime> EndDate { get; set; }
|
|
78
|
|
79 public string Description { get; set; }
|
|
80
|
|
81 public string Extra { get; set; }
|
|
82
|
|
83 public LightStation.API.NullableStationObjectID DataProvenanceId { get; set; }
|
|
84
|
|
85 public LightStation.API.NullableStationObjectID CountryId { get; set; }
|
|
86
|
|
87 public LightStation.API.NullableStationObjectID CurrencyId { get; set; }
|
|
88
|
|
89 public LightStation.API.NullableStationObjectID DataProviderAccountId { get; set; }
|
|
90
|
|
91 public LightStation.API.NullableStationObjectID PrimaryExchangeId { get; set; }
|
|
92
|
|
93 public LightStation.API.NullableStationObjectID CompositeExchangeId { get; set; }
|
|
94
|
|
95 public string Name { get; set; }
|
|
96
|
|
97 public string PrimaryTicker { get; set; }
|
|
98
|
|
99 public DateTime AsOfDate { get; set; }
|
|
100 }
|
|
101 }
|
|
102
|
|
103 namespace LightStation.Storage.Relational
|
|
104 {
|
|
105 [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
106 class <>c__DisplayClass2
|
|
107 {
|
|
108 public System.Linq.IQueryable<LightStation.API.MachineIdentifier> dateIdentifiers;
|
|
109
|
|
110 public Nullable<DateTime> asOfDate;
|
|
111 }
|
|
112 }
|
|
113
|
|
114 namespace LightStation.Storage.Relational
|
|
115 {
|
|
116 public interface IHasDbId<I>
|
|
117 {
|
|
118 }
|
|
119 }
|
|
120
|
|
121 namespace LightStation.Storage.Relational
|
|
122 {
|
|
123 [BLToolkit.DataAccess.TableNameAttribute(Name = "ls_exchange")]
|
|
124 public class ls_exchange : LightStation.Storage.Relational.IHasDbId<int>
|
|
125 {
|
|
126 public int organization_id { get; set; }
|
|
127 }
|
|
128 }
|
|
129
|
|
130 namespace LightStation.Storage.Relational
|
|
131 {
|
|
132 [BLToolkit.DataAccess.TableNameAttribute(Name = "ls_symbol")]
|
|
133 public class ls_symbol : LightStation.Storage.Relational.IHasDbId<int>
|
|
134 {
|
|
135 [BLToolkit.DataAccess.PrimaryKeyAttribute((Int32)1)]
|
|
136 [BLToolkit.DataAccess.IdentityAttribute()]
|
|
137 public int id { get; set; }
|
|
138
|
|
139 public string unique_id { get; set; }
|
|
140
|
|
141 public bool is_active { get; set; }
|
|
142
|
|
143 [BLToolkit.Mapping.NullableAttribute()]
|
|
144 public string type_name { get; set; }
|
|
145
|
|
146 public DateTime start_date { get; set; }
|
|
147
|
|
148 [BLToolkit.Mapping.NullableAttribute()]
|
|
149 public Nullable<DateTime> end_date { get; set; }
|
|
150
|
|
151 [BLToolkit.Mapping.NullableAttribute()]
|
|
152 public Nullable<int> data_provenance_id { get; set; }
|
|
153
|
|
154 [BLToolkit.Mapping.NullableAttribute()]
|
|
155 public Nullable<int> country_id { get; set; }
|
|
156
|
|
157 [BLToolkit.Mapping.NullableAttribute()]
|
|
158 public Nullable<int> currency_id { get; set; }
|
|
159
|
|
160 [BLToolkit.Mapping.NullableAttribute()]
|
|
161 public Nullable<int> data_provider_account_id { get; set; }
|
|
162
|
|
163 [BLToolkit.Mapping.NullableAttribute()]
|
|
164 public Nullable<int> primary_exchange_id { get; set; }
|
|
165
|
|
166 [BLToolkit.Mapping.NullableAttribute()]
|
|
167 public Nullable<int> composite_exchange_id { get; set; }
|
|
168
|
|
169 [BLToolkit.Mapping.NullableAttribute()]
|
|
170 public string description { get; set; }
|
|
171
|
|
172 [BLToolkit.Mapping.NullableAttribute()]
|
|
173 public string extra { get; set; }
|
|
174
|
|
175 [BLToolkit.Mapping.AssociationAttribute(ThisKey = "primary_exchange_id", OtherKey = "id", CanBeNull = True)]
|
|
176 public LightStation.Storage.Relational.ls_exchange symbolexchangeprimary { get; set; }
|
|
177 }
|
|
178 }
|
|
179
|
|
180 namespace LightStation.Storage.Relational.Tests.IRelationalStorageTests
|
|
181 {
|
|
182 [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
183 class <>c__DisplayClassa5
|
|
184 {
|
|
185 public LightStation.API.Symbol symbol;
|
|
186 }
|
|
187 }
|
|
188
|
|
189 namespace LightStation.Utils.Validation
|
|
190 {
|
|
191 public interface IValidatable
|
|
192 {
|
|
193 }
|
|
194 }
|
|
195
|
|
196 namespace Data.Linq
|
|
197 {
|
|
198 [TestFixture]
|
|
199 public class UserTest : TestBase
|
|
200 {
|
|
201 [Test]
|
|
202 public void Test()
|
|
203 {
|
|
204 // Table(ls_symbol).Select(symbol => new <>f__AnonymousType1`2(symbol = symbol, name = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).dateIdentifiers.Where(x => ((Convert(x.OrganizationId) == Convert(Organization.SelfId)) AndAlso (x.SymbolId.Value == symbol.id))).Select(x => x.Value))).Select(<>h__TransparentIdentifier0 => new <>f__AnonymousType2`2(<>h__TransparentIdentifier0 = <>h__TransparentIdentifier0, primaryTicker = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).dateIdentifiers.Where(x => ((Convert(x.OrganizationId) == <>h__TransparentIdentifier0.symbol.symbolexchangeprimary.organization_id) AndAlso (x.SymbolId.Value == <>h__TransparentIdentifier0.symbol.id))).Select(x => x.Value).FirstOrDefault())).Select(<>h__TransparentIdentifier1 => new Symbol() {Id = new StationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.id}, UniqueId = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.unique_id, TypeName = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.type_name, IsActive = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.is_active, StartDate = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.start_date, EndDate = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.end_date, Description = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.description, Extra = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.extra, DataProvenanceId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.data_provenance_id}, CountryId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.country_id}, CurrencyId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.currency_id}, DataProviderAccountId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.data_provider_account_id}, PrimaryExchangeId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.primary_exchange_id}, CompositeExchangeId = new NullableStationObjectID() {Value = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.symbol.composite_exchange_id}, Name = <>h__TransparentIdentifier1.<>h__TransparentIdentifier0.name.FirstOrDefault(), PrimaryTicker = <>h__TransparentIdentifier1.primaryTicker, AsOfDate = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).asOfDate.Value}).First(x => (Convert(x.Id) == Convert(value(LightStation.Storage.Relational.Tests.IRelationalStorageTests.SymbolTests+<>c__DisplayClassa5).symbol.Id)))
|
|
205 ForEachProvider(db =>
|
|
206 Table(ls_symbol)
|
|
207 .Select(
|
|
208 // Unknown expression.
|
|
209 symbol => new <>f__AnonymousType1`2(symbol = symbol, name = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).dateIdentifiers.Where(x => ((Convert(x.OrganizationId) == Convert(Organization.SelfId)) AndAlso (x.SymbolId.Value == symbol.id))).Select(x => x.Value)))
|
|
210 .Select(
|
|
211 // Unknown expression.
|
|
212 tp0 => new <>f__AnonymousType2`2(tp0 = tp0, primaryTicker = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).dateIdentifiers.Where(x => ((Convert(x.OrganizationId) == tp0.symbol.symbolexchangeprimary.organization_id) AndAlso (x.SymbolId.Value == tp0.symbol.id))).Select(x => x.Value).FirstOrDefault()))
|
|
213 .Select(
|
|
214 // Unknown expression.
|
|
215 tp1 => new Symbol() {Id = new StationObjectID() {Value = tp1.tp0.symbol.id}, UniqueId = tp1.tp0.symbol.unique_id, TypeName = tp1.tp0.symbol.type_name, IsActive = tp1.tp0.symbol.is_active, StartDate = tp1.tp0.symbol.start_date, EndDate = tp1.tp0.symbol.end_date, Description = tp1.tp0.symbol.description, Extra = tp1.tp0.symbol.extra, DataProvenanceId = new NullableStationObjectID() {Value = tp1.tp0.symbol.data_provenance_id}, CountryId = new NullableStationObjectID() {Value = tp1.tp0.symbol.country_id}, CurrencyId = new NullableStationObjectID() {Value = tp1.tp0.symbol.currency_id}, DataProviderAccountId = new NullableStationObjectID() {Value = tp1.tp0.symbol.data_provider_account_id}, PrimaryExchangeId = new NullableStationObjectID() {Value = tp1.tp0.symbol.primary_exchange_id}, CompositeExchangeId = new NullableStationObjectID() {Value = tp1.tp0.symbol.composite_exchange_id}, Name = tp1.tp0.name.FirstOrDefault(), PrimaryTicker = tp1.primaryTicker, AsOfDate = value(LightStation.Storage.Relational.RelationalDbToBusinessObjectConverterExtensions+<>c__DisplayClass2).asOfDate.Value})
|
|
216 .First<LightStation.API.Symbol>(
|
|
217 // Unknown expression.
|
|
218 x => (Convert(x.Id) == Convert(value(LightStation.Storage.Relational.Tests.IRelationalStorageTests.SymbolTests+<>c__DisplayClassa5).symbol.Id))));
|
|
219 }
|
|
220 }
|
|
221 }
|
|
222
|
|
223 */ |