Ejemplo n.º 1
0
        public string[] GetAvailableChoicesFromField <T>(string propertyName)
        {
            string listTitle      = EntityHelper.GetDisplayNameFromEntitiyType(typeof(T));
            List   sharePointList = _clientContext.Web.Lists.GetByTitle(listTitle);

            _clientContext.Load(sharePointList);
            _clientContext.ExecuteQuery();

            var property = typeof(T).GetProperty(propertyName);

            FieldChoice choiceField = _clientContext.CastTo <FieldChoice>(_awecsomeField.GetFieldDefinition(sharePointList, property));

            _clientContext.Load(choiceField, q => q.Choices);
            _clientContext.ExecuteQuery();

            return(choiceField.Choices);
        }