Files
Umbraco-CMS/LinqToUmbraco/src/umbraco.Linq/DTMetal.Engine/Extensions.cs
slace 91e677d7c4 DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB
Fixing the auto generated code for linq to umbraco

[TFS Changeset #58744]
2009-09-03 06:33:49 +00:00

50 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.DataLayer;
using System.Data.SqlTypes;
namespace umbraco.Linq.DTMetal.Engine
{
public static class Extensions
{
public static string GetAlias(this IRecordsReader reader)
{
return reader.GetString("Alias");
}
public static string GetName(this IRecordsReader reader)
{
return reader.GetString("Name");
}
public static int GetId(this IRecordsReader reader)
{
return reader.GetInt("Id");
}
public static string GetDescription(this IRecordsReader reader)
{
return reader.GetString("Description");
}
public static string GetDbType(this IRecordsReader reader)
{
return reader.GetString("DbType");
}
public static int GetParentId(this IRecordsReader reader)
{
try
{
return reader.GetInt("ParentId");
}
catch (SqlNullValueException)
{
return 0;
}
}
}
}