Beispiel #1
0
        public override IList <IDataObject> Get(string objectType, IList <string> identifiers)
        {
            _dataObjects = new List <IDataObject>();

            try
            {
                switch (objectType.ToUpper())
                {
                case "WIDGET":

                    foreach (string identifier in identifiers)
                    {
                        int id = 0;
                        Int32.TryParse(identifier, out id);

                        Widget widget = _widgetProvider.ReadWidget(id);

                        IDataObject dataObject = FormDataObject(widget);

                        _dataObjects.Add(dataObject);
                    }
                    break;

                default:
                    throw new Exception("Invalid object type provided");
                }
            }
            catch (Exception ex)
            {
                _logger.ErrorFormat("Error while getting list of specified data objects of type [{0}]: {1}", objectType, ex);
                throw new Exception("Error while getting list of specified data objects of type [" + objectType + "].", ex);
            }

            return(_dataObjects);
        }
Beispiel #2
0
        public Widget Get(string identifier)
        {
            Widget widget = _widgetProvider.ReadWidget(Int32.Parse(identifier));

            return(widget);
        }