private void Assert(IdentityResult result) { if (!result.Succeeded) { throw new InvalidOperationException(result.ToErrorString()); } }