【问题标题】:Not Implemented Exception while using Insight.Database micro ORM使用 Insight.Database 微 ORM 时未实现异常
【发布时间】: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


    【解决方案1】:

    如果您收到 NotImplementedException,并且运行 v4.1.0 到 4.1.3,您可能在注册数据库提供程序时遇到问题。

    我建议使用 v4.1.4 或更高版本,并确保为您的数据库注册提供程序。

    https://github.com/jonwagner/Insight.Database/wiki/Installing-Insight

    如果您还有其他问题,可以在 github 上发布问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-21
      相关资源
      最近更新 更多