c# - How to compare minutes portion only of a TimeSpan in LINQ to Entities? -
i have publication entity in model. want retrieve publications created less 10 minutes now.
var publications = myentities.publications. .where(p => p.creationuserid == exampleid && (datetime.now - p.creationdate).minutes < 10);
trying execute above statement, following exception: "dbarithmeticexpression arguments must have numeric common type.". tried appropriate function dbfunctions class, without success. can come solution this?
ok got skeeted add conversation , bit may useful others...
the method looking dbfunctions.diffminutes
. gives total number of minutes between 2 values.
var publications = myentities.publications. .where(p => p.creationuserid == exampleid && dbfunctions.diffminutes(p.creationdate, datetime.now) < 10);
Comments
Post a Comment