microsoft / DACExtensions

DACExtensions contains samples that extend Data-Tier Applications using DacFx. These samples include deployment contributors and static code analysis rules that can be used with Visual Studio as well as examples of how to use the DacFx public mode
MIT License
125 stars 41 forks source link

Allowing Column.DataType to handle DataType and UserDefinedType's #4

Closed GoEddie closed 9 years ago

GoEddie commented 9 years ago

The model that was generated for Column.DataType only allowed the return of the relationship for Microsoft.SqlServer.Dac.Model.DataType.TypeClass but Column.DataType can also be a Microsoft.SqlServer.Dac.Model.UserDefinedType.TypeClass so calling Column.DataType with a user defined data type would cause an exception in the TSqlColumnStoreIndexReference constructor.

I am not sure if this is the correct way to fix it but I added an additional RelationshipOverride property "AdditionalTypeClasses" and an extra attribute to the modelmetadata.xml and allowed the TSqlColumnStoreIndexReference ctor to take an array of types that it supports.

If there is a better fix let me know :)

lonnybastien commented 9 years ago

Hello Ed Thanks for your submission. I have submitted an alternate fix for the issue here: https://github.com/Microsoft/DACExtensions/commit/515b91716ef7a6ec7b6bbeee1d9cc535bf60d1f2 Have a look and let me know if this addresses your issue.