S
shapper
Hello,
I have the following:
boxStat = new BoxStat {
BoxCount = database.Boxes.Count(),
SinceLastCreate = (DateTime.Now - database.Boxes.Max(b =>
b.CreatedAt)).Days ?? 0
};
I am getting an error:
'System.Nullable<System.TimeSpan>' does not contain a definition for
'Days' and no extension method 'Days' accepting a first argument of
type 'System.Nullable<System.TimeSpan>' could be found (are you
missing a using directive or an assembly reference?)
I added ?? 0 to try to solve the problem but I keep having the same
error.
What am I doing wrong?
Thank You,
Miguel
I have the following:
boxStat = new BoxStat {
BoxCount = database.Boxes.Count(),
SinceLastCreate = (DateTime.Now - database.Boxes.Max(b =>
b.CreatedAt)).Days ?? 0
};
I am getting an error:
'System.Nullable<System.TimeSpan>' does not contain a definition for
'Days' and no extension method 'Days' accepting a first argument of
type 'System.Nullable<System.TimeSpan>' could be found (are you
missing a using directive or an assembly reference?)
I added ?? 0 to try to solve the problem but I keep having the same
error.
What am I doing wrong?
Thank You,
Miguel