使用EF5 CodeFirst迁移的MySql:更改表列名时出错(Fluent API)
我在MySql数据库中使用EF5 CodeFirst 我有一个“用户”类使用EF5 CodeFirst迁移的MySql:更改表列名时出错(Fluent API),mysql,ef-code-first,entity-framework-5,Mysql,Ef Code First,Entity Framework 5,我在MySql数据库中使用EF5 CodeFirst 我有一个“用户”类 public class User { [Key] public string Username { get; set; } public string DisplayName { get; set; } } 我想将表列DisplayName更改为display\u name protected override void OnModelCreating(DbModelBuilder modelB
public class User
{
[Key]
public string Username { get; set; }
public string DisplayName { get; set; }
}
我想将表列DisplayName更改为display\u name
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<User>()
.Property(u => u.DisplayName)
.HasColumnName("display_name");
}
我认为错误在这里->
set @columnType := (select case lower(IS_NULLABLE) when `no` then CONCAT(column_type, ` ` , `not null `) when `yes` then column_type end from information_schema.columns where table_name = `Users` and column_name = `DisplayName` );
否
是错误
请帮我纠正这个错误
set @columnType := (select case lower(IS_NULLABLE) when `no` then CONCAT(column_type, ` ` , `not null `) when `yes` then column_type end from information_schema.columns where table_name = `Users` and column_name = `DisplayName` );