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

Analyzer: Should consider Custom Serializers #4428

Open
jensbrand opened this issue Jan 8, 2025 · 1 comment
Open

Analyzer: Should consider Custom Serializers #4428

jensbrand opened this issue Jan 8, 2025 · 1 comment
Labels

Comments

@jensbrand
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In CSLA 9 the MobileFormatter now supports the concept of custom serializers for types that are not normally serializable. You can configure these in your program's startup code like this:

builder.Services.AddCsla(o => o
  .Serialization(s => s
    .UseMobileFormatter(m => m
      .CustomSerializers.Add(
        new TypeMap<MyType, PocoSerializer<MyType>>(PocoSerializer<MyType>.CanSerialize))
    ))));

If you use such type in any DataPortal operation the warning "CSLA0010 : Operation argument types should be serializable" is thrown.

Describe the solution you'd like
The analyzer should consider the custom serializers and not throw this warning.

Describe alternatives you've considered
You can ignore the warning but then you have to check the correct serialisation of all the custom types.

@rockfordlhotka
Copy link
Member

Thank you @jensbrand, this is a good observation!

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

No branches or pull requests

2 participants