c# - error CS0104: 'EntityState' and I have framework 6 -
i getting these errors:
error cs0104: 'entitystate' ambiguous reference between 'system.data.entitystate' , 'system.data.entity.entitystate'
error cs0266: cannot implicitly convert type 'system.data.entitystate' 'system.data.entity.entitystate'. explicit conversion exists (are missing cast?)
and culprit on line:
context.entry(order).state = entitystate.modified; (entitystate.modified being error.
the second error in particular surprised because performed instructions in link: https://msdn.microsoft.com/en-us/data/upgradeef6
yet, still getting problem entitystate
.
could please me?
if using both namespaces system.data
, system.data.entity
, both have property called entitystate
compiler can't decide use. in these cases need use full namespace references, system.data.entity.entitystate
, or use namespace aliasing: using akaentity = system.data.entity;
, access property akaentity.entitystate
.
Comments
Post a Comment