StevenRasmussen / EFCore.SqlServer.NodaTime

NodaTime support for EF Core
MIT License
105 stars 18 forks source link

Are standard operators supported? #18

Closed benmccallum closed 3 years ago

benmccallum commented 3 years ago

This is probably a stupid question, but trying to do due diligence before I jump all in on this. Awesome library and will make life so much better!

I can see that SQL functions are support like DateAdd, etc. but I couldn't find anything stating explicitly whether standard operators like <, >, == are translated.

e.g.

public class Posts 
{
   public Instant PublishedAt { get; set; }
}

var now = _clock.GetCurrentInstant();
var publishedPosts = db.Posts.Where(p => p.PublishedAt <= now).ToList();

Thought I'd ask in case anyone else has the same question and then I can PR a little tweak to the README to state yes/no.

Perhaps the ValueConverters just takes care of all of this, but I've never really used them so not sure.

StevenRasmussen commented 3 years ago

Hello! Yes, all the standard operators are supported ;)