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

建议扩展方法与所扩展的类型使用同一个命名空间 #1

Closed
cnblogs-dudu opened this issue Feb 5, 2023 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cnblogs-dudu
Copy link
Contributor

比如下面的扩展方法,如果命名空间改为 IEndpointRouteBuilder 所使用的 Microsoft.AspNetCore.Routing,调用时会更方便,不需要另外添加命名空间引用,智能感知直接就能出来

namespace Cnblogs.Architecture.Ddd.EventBus.Dapr;

public static IEndpointConventionBuilder Subscribe<TEvent>(this IEndpointRouteBuilder builder)
        where TEvent : IntegrationEvent
{
}
@ikesnowy
Copy link
Contributor

ikesnowy commented Feb 5, 2023

好像可以,EFCore 的 AddDbContext 就是这样的,我都改一下吧,针对 interface 的扩展方法确实可以不用单独的命名空间

@ikesnowy ikesnowy added this to the 15.1.0 milestone Feb 6, 2023
@ikesnowy ikesnowy added the enhancement New feature or request label Feb 6, 2023
@ikesnowy ikesnowy closed this as completed Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants