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

[AspNetCore]: Set more metadata on endpoints and allow conventions per service #425

Merged

Conversation

Daniel-Svensson
Copy link
Member

  • AspNetCore
    • Copies "All" attributes to endpoint metadata
      • Some attributes sucha as Validation, Authorization and other attributes specific to OpenRiaServices are not copied
    • AddDomainService() methods inside MapOpenRiaServices now returns IEndpointConventionBuilder allowing conventions to be specified per DomainService
      app.MapOpenRiaServices(builder =>
      {
          builder.AddDomainService<Cities.CityDomainService>()
              .WithGroupName("Cities");
      });
    • CHANGES:
      • services.AddOpenRiaServices<T>() now requires T to derive from DomainServce
      • services.AddOpenRiaServices<T>() has different return type

Comment on lines +198 to +202
foreach (Attribute attribute in attributes)
{
if (ShouldCopyAttributeToEndpointMetadata(attribute))
metadata.Add(attribute);
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
@Daniel-Svensson Daniel-Svensson added this to the 5.4 milestone Jun 20, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Daniel-Svensson Daniel-Svensson merged commit 0b18f56 into OpenRIAServices:main Jun 20, 2023
@Daniel-Svensson Daniel-Svensson deleted the feature/metadata_copy branch June 20, 2023 10:20
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

Successfully merging this pull request may close these issues.

1 participant