-
Notifications
You must be signed in to change notification settings - Fork 115
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
Refactor(MinimalAPI): Refactor MinimalAPIs #238
Conversation
{ | ||
public string? Pattern { get; set; } | ||
|
||
public string? Method { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string -> HttpMethod
[AttributeUsage(AttributeTargets.Method)] | ||
public class IncludeMappingAttribute : Attribute | ||
{ | ||
public string? Pattern { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern? It's need a commet and sample. For example regex?
@@ -1,15 +1,20 @@ | |||
// Copyright (c) MASA Stack All rights reserved. | |||
// Licensed under the MIT License. See LICENSE.txt in the project root for license information. | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove a blank line
} | ||
|
||
#endregion | ||
internal void AutoMapRouter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutoMapRoute, and it will support map group for .net 7.
{ | ||
var type = GetType(); | ||
|
||
var methods = type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing distinct?
if (methodName.StartsWith("Add", StringComparison.OrdinalIgnoreCase) || | ||
methodName.StartsWith("Upsert", StringComparison.OrdinalIgnoreCase)) return "POST"; | ||
|
||
if (methodName.StartsWith("Update", StringComparison.OrdinalIgnoreCase)) return "PUT"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update and Modify
public string? Version { get; set; } | ||
|
||
/// <summary> | ||
/// service name, defaults to null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why sometimes start with lowercase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaults to?
public class Url | ||
{ | ||
/// <summary> | ||
/// The prefix, the default is null, consistent with the global prefix, if it is string.Empty, the Prefix is ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatter is $"{Prefix}/{Version}/{ServiceName}"
, any one IsNullOrWhiteSpace
would be ignored.
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Refactor MinimalAPIs
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: