I want to do this:
public static void SetStringsToBeNonUnicode(this EntityTypeConfiguration<T> config)
{
}
compiler doesn't like the <T> in there, what is the correct syntax for this?
more context, EntityTypeConfiguration is an EntityFramework class, defined as
public class EntityTypeConfiguration<TEntityType> : StructuralTypeConfiguration<TEntityType> where TEntityType : class
This is what is causing my headache.
What I really want to end up with is being able to do something like this when configuring dbcontext class:
public class ReceiptEntityConfiguration: EntityTypeConfiguration<ReceiptEntity>
{
public ReceiptEntityConfiguration()
{
ToTable("vReceipt");
HasKey(r => r.ReceiptId);
this.SetStringsToBeNonUnicode(); //I want to make all string fields for this entity type (ReceiptEntity in this case) to be treated as not unicode.
...etc etc
}
}
EF6.0 handles this with Lightweight Conventions, but I can't use the beta bits for prod.