I have an entity(EF) with property int? priority.
I want to work with the entity across my platform.
Dictionary<int, Task> tasks = new Dictionary<int,Task>();
tasks.Add(task.Priority, task);
in the second row, I want to get Priority out of task and fire it an int. but I get an error that int? is not int, which is true.
How to handle this situation
Thanks
You can use the Value Property witch gets the value of the current Nullable value.
But be aware to the HasValue Property so you can provide a default value in case its false.