Project works fine in ASP.NET Core 6.0 but when I tried to migrate it to 7.0, it builds successfully without errors but at runtime I got this error:
Message "GenericArguments[0], 'AbilityFix.Model.Models.Forums', on 'T MaxIntegerT' violates the constraint of type 'T'." string
InnerException {"Method System.Linq.Enumerable.MaxInteger: type argument 'AbilityFix.Model.Models.Forums' violates the constraint of type parameter 'T'."}
System.Exception {System.Security.VerificationException}
Error in startup.cs
file
services.AddAutoMapper(mapperConfig => mapperConfig.AddProfiles(GetType().Assembly));