I just got Visual-Studio 2012 Professional and am using the Entity-Framework (5.0) designer. I've been trying to convert a property to an Enum, and according to this Microsoft video I right click the property and choose Convert to Enum
at (2:06) - there is no option for converting in my context menu.
Here I'm trying to convert Role to Enum. I've set Role to be an Int32.
What am I doing wrong?
Following the video in the post closely, I opened the Model Browser
to add an Enum manually. After I had done so, and set the Role to the enum I had created. To test if I could now Convert To Enum
on the property, I changed the type back to Int32 and then right clicked the property and and low and behold I see the Convert To Enum
option in the context menu!
So, if your having problems these are the steps I used to enable the Convert To Enum
option. This is a hack in my opinion, as now I cannot reproduce this behavior with a new solution and project. Apparently once the Model Browser has been opened for the first time (or the complete steps below) it now shows the Convert To Enum
option.
-1. Using the Quick Launch search window, I typed in Model Browser
and opened it up.
-2. Choose Add New Enum Type...
from right clicking Enum Types
in the Model Browser for your Data Model.
-3. Set your property to the enum, scroll to the bottom of the listed types in the combo-box and choose the enum.
i had this problem too!! i changed entity framework from 4 to 4.5 and problem solved! ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With