Reputation:
With Entity Framework from SQL I am accessing a field that its schema says "bit
"
Now I want to put it in C# code in an int
I wrote something like this: Is this correct? or there are other ways?
int myResult = Convert.ToInt32(ef.thatField);
Upvotes: 0
Views: 3998
Reputation: 5933
maybe you can try this :
int myResult = ef.thatField ? 1 : 0;
Upvotes: 5