public static User Data(this IIdentity identity) { Contract.Requires(null != identity); if (identity.IsAuthenticated) { var user = new User() { NameIdentifier = identity.NameIdentifier() }; var userApp = new UserApplication() { Application = Application.Current, User = user, }; return(userCore.GetByNameIdentifier(userApp)); } else { return(null); } }