// <summary> // Constructor to create an instance of DefaultObjectMappingItemCollection. // To start with we will create a Schema under which maps will be created. // </summary> public DefaultObjectMappingItemCollection( EdmItemCollection edmCollection, ObjectItemCollection objectCollection) : base(DataSpace.OCSpace) { DebugCheck.NotNull(edmCollection); DebugCheck.NotNull(objectCollection); _edmCollection = edmCollection; _objectCollection = objectCollection; var cspaceTypes = _edmCollection.GetPrimitiveTypes(); foreach (var type in cspaceTypes) { var ospaceType = _objectCollection.GetMappedPrimitiveType(type.PrimitiveTypeKind); Debug.Assert(ospaceType != null, "all primitive type must have been loaded"); AddInternalMapping(new ObjectTypeMapping(ospaceType, type), _clrTypeIndexes, _edmTypeIndexes); } }