first of all I try to make a class and then make a database via add-migration Initial
and update-database
.
I wrote the class below and the soustraction DateTime.Now - SoldPr
below is didn't recognized.
Recognized means :
Argument 1 of DateTime.Now - SoldPr
: impossible conversion of 'System.TimeSpan' to 'decimal' [Test_Dev]csharp(CS1503).
I don't know to solve this problem.
public class Change
{
public DateTime SoldPr { get; set; }
public int RAF{
get
{
if(SoldPr.Year > 0 )
{
return(int) Math.Floor(DateTime.Now - SoldPr).Days;
}
else
{
return 0;
}
}
}
}
Thanks in advance