I have a database with a view that has an integer FK. When I create my model in VS and look at the diagram the view has the column as a string/varchar. I have removed the table and re-added it but it still creates the entity with a string property.
If I select the view then over in Properties change Type to Int32 the build completes without errors, but breaks at the first call of the DB context saying the store and model don't match up.
DB table:
TariffKey : int
CompanyKey : int
ChargeTypeKey : int
ChargeTypeName : varchar(80)
Value : numeric
StartDate : datetime
EndDate : datetime
Model mapping:
TariffKey : int (Int32)
CompanyKey : int (Int32)
ChargeTypeKey : varchar (String)
ChargeTypeName : varchar (String)
Value : numeric (Decimal)
StartDate : datetime (DateTime)
EndDate : datetime (DateTime)