Invalid redundant cast

public string CurrentUserName
{
get
{
return ((ERPIDentity)Thread.CurrentPrincipal.Identity).Name;
}
}

Is flagged as redundant (which it isn't ofcourse, as IPrincipal doesn't have a property Name).

0
2 comments
Avatar
Permanently deleted user

Jesse Houwing wrote:

public string CurrentUserName
{
get
{
return ((ERPIDentity)Thread.CurrentPrincipal.Identity).Name;
}
}

Is flagged as redundant (which it isn't ofcourse, as IPrincipal
doesn't have a property Name).


Well, you are looking at IIdentity which of course has a property
'Name'...

--
Immo Landwerth - Visual Studio 2003 - C# - XanaNews 1.17.4.1

0
Avatar
Permanently deleted user

Argh! must have seen that :)

Sorry!

0

Please sign in to leave a comment.