我打算将我的系统移动到通用服务层.
public interface IAbcService<TEntity> where TEntity : class
public class AbcService<TEntity> : IAbcService<TEntity> where TEntity : class
Run Code Online (Sandbox Code Playgroud)
我尝试了一些东西,但它不起作用.
services.AddTransient<typeof(IAbcService<MyEntity>), AbcService();
....
....
....
Run Code Online (Sandbox Code Playgroud)
我正在使用我的一些实体,并且我正在尝试将其添加到属性中.
如何在asp.net核心中注册通用服务?