Skip to content

关于特性注入的问题 #10

@Development-Enthusiast-HHW

Description

对于继承自接口interface,实现一对多功能的interface,能否自动生成代码
例如:
public partial class UserService : BaseAutoService<Bus_User, UserParam>, IUserService
需要注入IUserService时需要在Program中添加:
builder.Services.AddSingleton<IUserService, UserService>();
如果又有新的实现类NewUserService继承IUserService,
就需要再次在Program中添加builder.Services.AddSingleton<IUserService, NewUserService>();
在您提供的原有的Service方法中,该怎样才能获取到对应继承父类信息,来添加自动生成的代码,想请教以下这点,谢谢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions