I'm using the new WIF 4.5 SDK, but i have the same annoying exception that with LINQ is resolved with .FirstorDefault()
var claimEmail = ClaimsPrincipal.Current.FindFirst(ClaimTypes.Email).Value;
The problem here is that Windows Live ID have no email value in the claim, so if an user log in with a live ID i have a NullReferenceException - Object reference not set to an instance of an object. I also tried;
var claimEmail = ClaimsPrincipal.Current.FindFirst(ClaimTypes.Email).Value.FirstorDefault();
without success
How can i return NULL or "" if ther's no email in the claim?
Thanks