我正在使用MVC - WCF Service
和Fluent NHibernate
,但我遇到了错误
关于连接。
方法add_PropertyChanged
应为'public / protected virtual'或'protected internal virtual
public class ReportService : IReportService
{
protected static List<Customer> Customers;
public List<Customer> GetReport(string Name,string Surname,string Address,string Phone) {
//NHibernate üzerinden select
Customers = new List<Customer>();
using (var session = NHibernateHelper.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
var results = from c in session.Query<Customer>()
select c;
foreach (var result in results)
{
Customer customer = new Customer
{
CustomerId = result.CustomerId,
Name = result.Name,
Surname = result.Surname,
Address = result.Address,
Phone = result.Phone
};
Customers.Add(customer);
}
if (Customers.Count>0)
{
return Customers;
}
else
{
return null;
}
}
}
}
实体:
public class Customer
{
public virtual int CustomerId { get; set; }
public virtual string Name { get; set; }
public virtual string Surname { get; set; }
public virtual string Phone { get; set; }
public virtual string Address { get; set; }
}