private bool IsValidKey(object id)
{
if (id != null)
{
if (id.GetType() == typeof(String))
{
return id.ToString() != String.Empty;
}
else if (id.GetType() == typeof(Guid))
{
return Guid.Empty != ((Guid) id);
}
else
{
return Convert.ToInt64(id) != 0;
}
}
return false;
}