Check if member exist Umbraco C#

To check if a user exist in the Umbraco membership section, we use the ASP.NET Membership API.

var userName = "myUserName";
var memberExist = false;
 
if(Membership.GetUser(userName) != null)
{
    memberExist = true;
}