public static void GetAttributeForGuid(string guid, HttpRequest.RequestResult <Rock.Client.Attribute> resultHandler) { string oDataFilter = string.Format("?$filter=Guid eq guid'{0}'", guid); RockApi.Get_Attributes(oDataFilter, delegate(System.Net.HttpStatusCode statusCode, string statusDescription, List <Rock.Client.Attribute> model) { if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true && model != null && model.Count > 0) { resultHandler(statusCode, statusDescription, model[0]); } else { resultHandler(statusCode, statusDescription, null); } }); }
public static void GetAttribute(int[] attributeIds, HttpRequest.RequestResult <List <Rock.Client.Attribute> > resultHandler) { string oDataFilter = "?$filter={0}&$expand=AttributeQualifiers,FieldType&$orderby=Id"; // build the full list of attributes to request. Start with the first string attribIdsString = string.Format("Id eq {0}", attributeIds[0]); // and 'or' in any additional for (int i = 1; i < attributeIds.Length; i++) { attribIdsString += string.Format(" or Id eq {0}", attributeIds[i]); } string oDataFullFilter = string.Format(oDataFilter, attribIdsString); RockApi.Get_Attributes(oDataFullFilter, resultHandler); }