i'm trying to use Belgrade-SqlClient (Small async ADO.NET helper library)
in c# web api all is fine but when i try to register Icommand as a service
i got error:
System.ArgumentException: 'The service type ICommand is not supported. Parameter name: serviceType
this is my webapiconfig.cs where i add ICommand as service:
string Conn = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; ;
config.Services.Add(typeof(ICommand), new Command(Conn));
and this is Icommand:
using System.Threading.Tasks;
namespace Belgrade.SqlClient
{
public interface ICommand : IQueryMapper, IQueryPipe
{
Task Exec();
}
}