Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] add min and max at static methods #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

itsmuntadhar
Copy link

First, I would like to say thanks for the great work!

We've been looking into ULID to use instead of UUID/GUID in our projects and figured we could get rid of the dedicated "CreatedAt" column/prop that we usually have.

To make querying easier, we thought such methods would be great to have in the lib so we could do something like

var anHourAgo = DateTimeOffset.UtcNow.AddHours(-1);
var idGte = Ulid.MinAt(anHourAgo);
queryable = queryable.Where(x => x.Id >= idGte);

Was also looking into writing a couple more extensions, maybe in another PR.
Basically

DateTimeOffset.UtcNow.NewUlid();
DateTimeOffset.UtcNow.MinUlid();
DateTimeOffset.UtcNow.MaxUlid();

Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant