RobDog888
RobDog888

Reputation: 239

Boxing/Unboxing Nullable Int to Nullable Short

I need to take a nullable int and cast it as a nullable short. How can I get around the narrowing convention?

Upvotes: 0

Views: 376

Answers (1)

Softwarehuset
Softwarehuset

Reputation: 815

int? dsd = 1;
short? dsddd = (short?) dsd;

It seems to work pretty well :)?

Upvotes: 2

Related Questions