NUlid icon indicating copy to clipboard operation
NUlid copied to clipboard

[feature] add min and max at static methods

Open itsmuntadhar opened this issue 2 years ago • 2 comments

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

itsmuntadhar avatar May 29 '23 14:05 itsmuntadhar

Hi!

I'm not sure why I missed this PR and never replied. I'll look into this soon(-ish) and get back to you. Just wanted to let you know your PR is appreciated and I apologize for missing it.

RobThree avatar May 15 '25 14:05 RobThree

Things happen :)

Will look into solving the conflicts shortly

itsmuntadhar avatar May 15 '25 17:05 itsmuntadhar