Getting MySQL exception for old Column name missing

112 Views Asked by At

Im trying to pull a list of Runs objects where the details match the Platform field. Platform used to be called PlatformName. I've removed the old column name everywhere including the DB and code. For some reason, I keep getting this error

MySql.Data.MySqlClient.MySqlException: 'Unknown column 'r0.PlatformName' in 'field list''

Code:

    return Runs
        .Include("RunDetails")
        .Include("RunDetails.Proxy")
        .Include("RunDetails.Account")
        .Include("RunDetails.Account.Email")
        .Include("RunDetails.Account.Proxy")
        .Where(r => r.RunDetails.Any(rd => rd.Platform.Equals(platformName, StringComparison.OrdinalIgnoreCase))).AsNoTracking().ToList();
1

There are 1 best solutions below

0
Celso Jr On

I think you have to perform a database migration bro. Try something like this:

PS> Add-Migration ChangingColumnPlatformName
PS> Update-Database -Migration ChangingColumnPlatformName