Possible Duplicate:
Casting vs using the 'as' keyword in the CLR
C#: “is” vs “as”
This code:
if (sheet.Models.Data is GroupDataModel)
{
GroupDataModel gdm = (GroupDataModel)sheet.Models.Data;
and this code:
GroupDataModel gdm = sheet.Models.Data as GroupDataModel;
if (gdm != null)
{
Do you recommend any of the two styles above over the other one?