【发布时间】:2014-04-24 21:41:32
【问题描述】:
我尝试使用很酷的 Insight.Database 微 ORM,但每次尝试调用 CustomerRepository 中的 InsertCustomer 方法时都会遇到未实现的异常。任何帮助都将不胜感激
更新:我确保方法名称与 sql server 存储过程名称匹配
public class CustomerRepository
{
private ICustomerRepository _repo;
public static async Task<int> InsertCustomer(Customer cust)
{
var _repo = ConfigSettings.CustomerRepository;
return await _repo.InsertCustomer(cust);
}
}
public class ConfigSettings
{
private static ICustomerRepository _customerRepository;
public static ICustomerRepository CustomerRepository
{
get
{
if (_customerRepository == null)
{
_customerRepository = new SqlConnection(ConfigurationManager.ConnectionStrings["CustomerService_Conn_String"].ConnectionString).AsParallel<ICustomerRepository>();
}
return _customerRepository;
}
}
}
[Sql(Schema="dbo")]
public interface ICustomerRepository
{
[Sql("dbo.InsertCustomer")]
Task<int> InsertCustomer(Customer cust);
}
【问题讨论】:
标签: micro-orm insight.database