I am using C# in my backend and Angular in frontend and after upgrading dotnet to version 8 I am getting this error while trying to login through frontend - System.MissingMethodException: 'Method not found: 'Void CoreTypeMappingParameters..ctor(System.Type, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, System.Func`3<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>)'.'
Here in the return function I am getting this error-
public LoginResponce ValidateUserLogin(LoginRequest loginRequest){ MySqlParameter[] sqlParams = new MySqlParameter[1]; sqlParams[0] = new MySqlParameter { ParameterName = "loginId", MySqlDbType = MySqlDbType.VarChar, Value = loginRequest.UserId.StringVal() }; //return Context.Query<LoginResponce>().FromSql("Call ValidateUserLogin (@loginId)", sqlParams).FirstOrDefault(); return Context.LoginResponces.FromSqlRaw<LoginResponce>("Call ValidateUserLogin (@loginId)", sqlParams).FirstOrDefault();}
Here is the code for connecting with the database string -
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder){ optionsBuilder.ConfigureWarnings(warnings => warnings.Log(CoreEventId.LazyLoadOnDisposedContextWarning)); if (optionsBuilder.IsConfigured == false) { optionsBuilder.UseMySql(EntityConstants.SQLConnectionString, new MySqlServerVersion(new Version(8, 0, 33))) .UseLazyLoadingProxies(false) // <-- enable Lazy Loading .EnableSensitiveDataLogging() .EnableDetailedErrors(); }}
I have tried the following things
I added 'TrustServerCertificate=True' to my database connection string.
Check that all versions are compatible with EntityFrameworkCore.MySql.