Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while mapping proxies for Entities in net9.0 #716

Closed
sukreshmanda opened this issue Nov 6, 2024 · 1 comment
Closed

Error while mapping proxies for Entities in net9.0 #716

sukreshmanda opened this issue Nov 6, 2024 · 1 comment

Comments

@sukreshmanda
Copy link

Dotnet Version: 9.0.100-preview.7.24407.12

Fluent-NHibernate Version: 3.4.0

Code Used

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()
@hazzik
Copy link
Member

hazzik commented Nov 7, 2024

Update NHibernate to 5.5.2

This is a duplicate of nhibernate/nhibernate-core#3536

@hazzik hazzik closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants