public static string GetEmailAddresses(RestCommand command) { EmailAddresses emailAddresses = new EmailAddresses(command.LoginUser); emailAddresses.LoadByOrganizationID(command.Organization.OrganizationID); if (command.Format == RestFormat.XML) { return(emailAddresses.GetXml("EmailAddresses", "EmailAddress", true, command.Filters)); } else { throw new RestException(HttpStatusCode.BadRequest, "Invalid data format"); } }