我想用
Belgrade-SqlClient (Small async ADO.NET helper library)
在C Web API中
一切都很好,但当我尝试将icommand注册为服务时
我搞错了:
System.ArgumentException: 'The service type ICommand is not supported. Parameter name: serviceType
这是我的webapiconfig.cs,我在其中添加icommand作为服务:
string Conn = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; ;
config.Services.Add(typeof(ICommand), new Command(Conn));
这是我的命令:
using System.Threading.Tasks;
namespace Belgrade.SqlClient
{
public interface ICommand : IQueryMapper, IQueryPipe
{
Task Exec();
}
}