开发者

Member Mapping specified is not valid.Error in ADO.net Entity Framework when add new column in database?

I am very new to ADo.net entity framework and i am getting the following error

 The type 'Edm.Byte' of the member 'IsActive' in the conceptual side type 
 NopSolutions.NopCommerce.BusinessLogic.Data.Language' does not match with the type 
 System.Boolean' of the member 'IsActive' on the object side type   NopSolutions.NopCommerce.BusinessLogic.Directory.Language'.

as far i understand that there is some missing to relating the data type of edm and object

but i m开发者_如何学Goade a column in database table which is bit type and in langauge.cs i declare the property of

   public bool IsActive { get; set; }

any details needed i can post here

EDIT :

as i google around i found this question on stackoverflow

et-model-property-to-boolean-in-entity-framework which is changing the Byte to Boolean for mapping tinyint

but in my case i have in database is also the bit.


Assuming that you have an .edmx-file you can modify. Open it in an XML-editor and search for the <edmx:ConceptualModels>-element. This should contain the definition of your entities, look for the <EntityType Name="Language">-element, which should declare something like this:

<Property Name="IsActive" Type="Byte" Nullable="false" />

Change the Type-attribute to Boolean.

I'm pretty sure that you could also do this in the designer, but if you don't have direct access to the .edmx let me know and we figure something out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜