2
I have a select on the bench that brings several items and loads everything into one model. The point is that one of the items, depending on how the select is done, is brought in a different type. Ex:
The property on the model:
public int procodigo { get; set; }
The content to be loaded in this property can be int or decimal, depending on the client’s action.
I could create two models, but I think it can be kind of messed up.
Thanks in advance!
Why not just use one decimal?
– Evandro Silva
@Evandrosilva Because for some reason at the time of putting an integer number inside it gives Exception.
– Junior Dias
Only cast to decimal:
decimal x = (decimal)y
– Evandro Silva
@Juniordias Qual Exception?
– Leonel Sanches da Silva
@Ciganomorrisonmendez Essa Exception: "The specified cast from a materialized 'System.Int32' type to the 'System.Decimal' type is not Valid."
– Junior Dias
Like your table, why don’t you practice it?
– user6026