convertion of ObjectResult<Nullable<int>> type to int

Viewed 6826

Stored proc return as ObjectResult<Nullable<int>> using Entity frame work and want to convert this to int type or how to check this value with another integer value

3 Answers

The easiest way:

Nullable<int> myValue = myDb.MY_STORED_PROCEDURE().FirstOrDefault();
int a = myValue.Value;
Related