Skip to content

Exception is thrown if type is placed in the Validation namespace #669

@nZeus

Description

@nZeus

Describe the bug

This worked well before v5.0.0

Place your type inside the Validation folder:

using Vogen;

namespace Xxx.Validation;

[ValueObject<string>]
public partial record MyValueType {
	//...
}

This error is thrown from the generated class:
error CS0234: The type or namespace name 'Invalid' does not exist in the namespace Xxx.Validation' (are you missing an assembly reference?)`

I think it is related to this piece of code:

return new ValueObjectOrError<{{className}}>(Validation.Invalid("The value provided was null"));

Kind regards,
Ilia

Steps to reproduce

^

Expected behaviour

^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions