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

Result type not serializable #584

Open
pada57 opened this issue Nov 15, 2024 · 1 comment
Open

Result type not serializable #584

pada57 opened this issue Nov 15, 2024 · 1 comment

Comments

@pada57
Copy link

pada57 commented Nov 15, 2024

Hello,

we are using your library heavily which is nice by the way, thanks your work. We ran into issues while using Result types within MassTransit as while serializing and deserializing Result type lead to RUntime exception as there are exceptions raised on Getter property methods like here below.

Why this type is flag as Serializable but raise exceptions on properties get ? did we miss something and can you help as this sounds like common issue

public T Value
{
    get
    {
        if (!IsSuccess)
        {
            throw new ResultFailureException(Error);
        }
@vkhorikov
Copy link
Owner

It shouldn't really be serializable for this exact reason. I recommend using separate DTOs for serializing/deserializing results.

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

No branches or pull requests

2 participants