Hi,
I've found a following bug when you use EntityFramework.SqlServerCompact provider:
If you wants to have nchar(n) in the database and tries to use Code First DataAnnotations to describe a property - app fails either to create database or read data from existing one
```
[StringLength(3)]
[Column(TypeName = "char")]
public string ThreeLetterISOName { get; set; }
```
It works perfectly on SQL LocalDB.
As a workaround I've used the Fluent API. First of all you have to remove [Column(TypeName = "char")] from your entity property:
```
[StringLength(3)]
public string ThreeLetterISOName { get; set; }
```
and in context class I've added:
```
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Language>().Property(t => t.ThreeLetterISOName).IsFixedLength();
}
```
This way it works with Sql Server Compact.
I've used EntityFramework 6.1.1 and EntityFramework.SqlServerCompact 6.1.1
I've found a following bug when you use EntityFramework.SqlServerCompact provider:
If you wants to have nchar(n) in the database and tries to use Code First DataAnnotations to describe a property - app fails either to create database or read data from existing one
```
[StringLength(3)]
[Column(TypeName = "char")]
public string ThreeLetterISOName { get; set; }
```
It works perfectly on SQL LocalDB.
As a workaround I've used the Fluent API. First of all you have to remove [Column(TypeName = "char")] from your entity property:
```
[StringLength(3)]
public string ThreeLetterISOName { get; set; }
```
and in context class I've added:
```
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Language>().Property(t => t.ThreeLetterISOName).IsFixedLength();
}
```
This way it works with Sql Server Compact.
I've used EntityFramework 6.1.1 and EntityFramework.SqlServerCompact 6.1.1