This is my List "lstTelephone". I want to fill the list and values of IsSMSOptIn and IsCall fields have to be filled using the logic below.

```
lstTelephone.Add(new PatronTelephones
{
    ContactType = dr["HomeTel1Type"].ToString(),
    Extension = "",
    PhoneNumber = dr["HomeTel1"].ToString(),
    IsSMSOptIn = false,
    IsCall = false
});

```

//Logic to fill IsSMSOptIn and IsCall fields

```
if(Helper.PreferredContactType.Equals(Helper.HomeAddressType,StringComparison.InvariantCultureIgnoreCase)==true)
{
    IsSMSOptIn = Convert.ToBool(dr["IsSMSSend"].ToString());
    IsCall = Convert.ToBool(dr["IsCall"].ToString());
}
else
{
    IsSMSOptIn = false;
    IsCall = false;
}

```

Following are the 2 ways which I am planning to use.

Method 1: Using conditonal operator to get the values based on condition

```
lstTelephone.Add(new PatronTelephones
{
    ContactType = dr["HomeTel1Type"].ToString(),
    Extension = "",
    PhoneNumber = dr["HomeTel1"].ToString(),
    IsSMSOptIn = Helper.PreferredContactType.Equals(Helper.HomeAddressType,StringComparison.InvariantCultureIgnoreCase)==true ? Convert.ToBool(dr["IsSMSSend"].ToString()) : false,
    IsCall = Helper.PreferredContactType.Equals(Helper.HomeAddressType,StringComparison.InvariantCultureIgnoreCase)==true ? Convert.ToBool(dr["IsCall"].ToString()) : false
});

```

Method 2: declaring separate variables to get the values based on condition and later the new variables will be assigned to list fields

```
bool SendSMS = false;
bool MakeCall = false;

if(Helper.PreferredContactType.Equals(Helper.HomeAddressType,StringComparison.InvariantCultureIgnoreCase)==true)
{
    SendSMS = Convert.ToBool(dr["IsSMSSend"].ToString());
    MakeCall = Convert.ToBool(dr["IsCall"].ToString());
}
else
{
    SendSMS = false;
    MakeCall = false;
}

lstTelephone.Add(new PatronTelephones
{
    ContactType = dr["HomeTel1Type"].ToString(),
    Extension = "",
    PhoneNumber = dr["HomeTel1"].ToString(),
    IsSMSOptIn = SendSMS,
    IsCall = MakeCall
});

```

Please suggest which method I can prefer. Which is the best way and performance wise. It would be great if any one provides the reason why one method is better than other.