public class Employee
{
public virtual string Name { get; set; }
public virtual long Id { get; set; }
}
public class EmployeeMap : ClassMap<Employee>
{
public EmployeeMap()
{
Table("employee");
Id(e => e.Id).CustomSqlType("Serial").GeneratedBy.Native();
Map(e => e.Name).Column("name");
}
}
Error:
NHibernate.InvalidProxyTypeException: The following types may not be used as proxies:
TodoAPI.Models.Employee: method MemberwiseClone should be 'public/protected virtual' or 'protected internal virtual'
at NHibernate.Cfg.Configuration.ValidateEntities()
at NHibernate.Cfg.Configuration.Validate()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
Dotnet Version: 9.0.100-preview.7.24407.12
Fluent-NHibernate Version: 3.4.0
Code Used
Error: