Skip to content

[Proposal] Add Guid-backed id which disallows Guid.EmptyΒ #84

@hankovich

Description

@hankovich

We use guid-backed ids a lot, but since they may represent Empty (which it almost never a possible value), we have to do a lot of

if (id == TId.Empty)
{
    throw null!; // well, any stupid handling
}

checks. It looks like adding a new backing type (NotEmptyGuid) will be handy.

Probably we can go even deeper and introduce a new AllowEmpty parameter, because empty strings and zero ints/longs are also usually represent invalid identifiers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions