5
My property allows values double
and values null
.
In the SQL Server Database it is set to decimal(18, 2)
.
But when seventh some value (ex: 5.00
), makes the mistake below.
Error:
The 'Rating' Property on 'Occurrence' could not be set to a 'System.Decimal' value. You must set this Property to a non-null value of type 'System.Double'.
Model:
public class Ocorrencia
{
[Key]
public int id { get; set; }
public double? Avaliacao { get; set; }
}
How it should stay to function properly?
Would not be
ocorrencia.Avaliacao = (double)5.00;
?– Bruno Heringer
I made this slip and already corrected rsrsrs
– Tiago S