Thursday 7 January 2016

ASP.NET Tips #64 - Avoid issues with string queries

Instructing Entity Framework to use the right kind of string when generating queries can resolve datatype conversion issues. A simple solution is to introduce Column Annotation:

public class MyTable
   public string Property1 { get; set; }

This is particularly valid for string datatypes where .NET Strings are Unicode by default and are not the same in SQL Server.

For more information, see:

No comments :

Post a Comment