Reputation: 339
I am using Fluent Nhibernate with MySQL Configuration to expose schema. Below is my database entity with entity mapping.
public class MyEntity
{
public MyEntity() { }
public virtual int ID {get;set;}
public virtual string FormalName { get; set; }
}
public class MyEntityMap : ClassMap<MyEntity>
{
public MyEntityMap()
{
Table("MyEntity");
LazyLoad();
Id(x => x.ID).GeneratedBy.Assigned().Column("ID");
Map(x => x.FormalName).Column("FormalName").Length(200); // In Script must be FormalName VARCHAR(200) CHARSET Latin1
}
Upvotes: 0
Views: 138
Reputation: 11
Simplest way as I think would be to add CustomSQLType in Map and add CHARSET within it.
eg.
Your code should be :
Map(x => x.FormalName).Column("FormalName").CustomSqlType("varchar(200) charset latin1").Length(200); // In Script must be FormalName VARCHAR(200) CHARSET Latin1
Notice the CustomSqlType in above code.
Upvotes: 1