I'm learning Entity Framework on Azure and the ID field is required to be nvarchar(255)
. When I attached to the DB to get the model it pulled down the ID field as type string which was giving me issues when inserting a new record. The solution was to switch the type string to type Guid. Then I could submit a new record and the "default" sql value would generate the new Guid.
However, after I went through the model and reset the id's from string to Guid I got the following message which isn't making a lot of sense to me:
Error 2019: Member Mapping specified is not valid. The type 'Edm.Guid[Nullable=False,DefaultValue=]' of member 'id' in type 'LearnModel.AdminList' is not compatible with 'SqlServer.nvarchar[Nullable=False,DefaultValue=,MaxLength=255,Unicode=True,FixedLength=False]' of member 'id' in type 'LearnModel.Store.AdminList'
I'm thinking it may be the Unicode=true that's giving me the issue but I don't see anywhere this can be set in the model within VS. I found another post that mentions going in and editing the edmx to add in the Unicode=true but this would get overwritten the next time the model is validated.
Anyone know what I'm running into here?