Attribute: [Unicode]
Posted by Gerhard Stephan on 7th March 2008
For all databases that supports Unicode (e.g. Oracle and Microsoft SQL Server), a string property can be tagged with the [Unicode] attribute. The AdFactum ObjectMapper .NET does therefore use the Unicode Data Types for the specific property.
Below you’ll find all supported datatypes that can be used with the Unicode attribute.
public class UnicodeTestEntity : ValueObject
{
private char unicodeChar;
private string unicodeString;
private string unicodeMemo;
/// <summary>
/// Gets or sets the unicode char.
/// </summary>
/// <value>The unicode char.</value>
[Unicode]
public char UnicodeChar
{
get { return unicodeChar; }
set { unicodeChar = value; }
}
/// <summary>
/// Gets or sets the unicode string.
/// </summary>
/// <value>The unicode string.</value>
[Unicode]
[PropertyLength(30)]
public string UnicodeString
{
get { return unicodeString; }
set { unicodeString = value; }
}
/// <summary>
/// Gets or sets the unicode memo.
/// </summary>
/// <value>The unicode memo.</value>
[Unicode]
[PropertyLength(int.MaxValue)]
public string UnicodeMemo
{
get { return unicodeMemo; }
set { unicodeMemo = value; }
}
}
Posted in Attributes | No Comments »
