Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static Country ConvertToCountry(sp.SPListItem item)
{
  Country newCountry = new Country();
  try
  {
    if (item != null)
    {
      newCountry.Id = int.Parse(item[Resources.Fields_Id].ToString());
      newCountry.Title = item.Fields.ContainsField(Resources.Fields_Title1) && item[Resources.Fields_Title1] != null ? item[Resources.Fields_Title1].ToString() : string.Empty;
      newCountry.BusinessUnit = item.Fields.ContainsField(Resources.Fields_Title) && item[Resources.Fields_Title] != null ? item[Resources.Fields_Title].ToString() : string.Empty;
    }
  }
  catch
  {
    throw;
  }
  return newCountry;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment