I have Versioned Maps objects that are represented/identified by 4 datatypes (or dimensions) like a guid, car, location, time, for e.g.
Tuple<GUID/Int64, AssetType, TimeT (can be.. DateTime/DateRange), LocationT (i.e. lat-long or SqlSpatial/SqlGeo)
MyCompositeType<MyKeyInt64,Tuple<T1,T2,T3,T4>>
This forms the composite key, but when one of the types inside the TupleKey Changes the EF and SQL primary breaks. Can you tell me how to model/declare this key and not break EF or the DB - so that I can change the types in my key, please sprinkle some wisdom, if I should get rid MyKeyInt64 and just work off the Tuple?
For e.g. <Int64,<Tuple<GUID, Car, DateRange, SpatialType>> If I pass in a different key type to the same CompositeType<Int64, Tuple<Int64, Truck, DateTime, SpatialType>
Background:
The combination of the data represents a key / unique version of a map that forms a record. I'm cross walking between Asset/objects/list<> and the maps and need two-way access, i.e.
- a) i.e. given a map version/key (represented by the combination of the above)-- getback/access the corresponding -- objectsList<>, location and time
- or b) given the objectType, or time, get the corresponding maps
Since, most of the operations performed leverage the data in these 4 types in some combination of all or some of types. Hence I'm making a composite key
Question: How do I model this correctly as a composite key, where I can fit various Object/AssetTypes into the Composite type for EF compatibility and cross-walking between the Assetobjects and Maps, given, a time range, or asset type or map?
Aucun commentaire:
Enregistrer un commentaire