What is the correct way of writing typeof(Xml) for C# .NET? -


i'm making dictionary maps .net types sql server types. using msdn's "sql server data type mappings" page show me correct conversions are. @ bottom of table says .net framework type xml, , wrote:

{typeof (xml), "xml"} 

as key-value pair of dictionary. resharper has xml in red , says cannot resolve symbol. what's correct statement typeof(xml)? rest of dictionary looks , doesn't have problems:

private static readonly dictionary<type, string> sqlservermap = new dictionary<type, string> {     {typeof (int64), "bigint"},     {typeof (boolean), "bit"},     {typeof (byte[]), "binary"},     {typeof (double), "float"},     {typeof (int32), "int"},     {typeof (decimal), "decimal"},     {typeof (single), "real"},     {typeof (int16), "smallint"},     {typeof (datetime), "date"},     {typeof (timespan), "time"},     {typeof (string), "nvarchar"},     {typeof (guid), "uniqueidentifier"},     {typeof (byte), "tinyint"},     {typeof (xml), "xml"} }; 

to make mapping .net sql xml appears need use sqlxml type, there no direct xml type.

here detailed implementation example msdn.

when comes mapping can use xdocument etc if want , manually swap sqlxml persistence possibly?


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -