Why cannot I use if else statement inside this local variable account? Inside the "if" I'm planning to enter the code IsActive = "Yes", then inside the "else" IsActive = "No". But the IsActive string that I declared in the class is not appearing/suggesting.
private void btnAdd_Click(object sender, EventArgs e)
{
UserAccount account = new UserAccount()
{
FirstName = txtFirstName.Text,
LastName = txtLastName.Text,
Email = txtEmail.Text,
TeamName = txtTeamName.Text,
Password = txtPassword.Text,
// IsActive = "Yes",
if (chkIsActive.Checked == true)
{
}
else
{
}
UserId = int.Parse(txtUserId.Text)
};
}