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).

2 comments
Comment actions Permalink

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
Comment actions Permalink

Argh! must have seen that :)

Sorry!

0

Please sign in to leave a comment.