Пример #1
0
        public static object GetValue(string handle)
        {
            object value;

            // TODO: We might be able to strongly type the GetObject...
            if (_objectHandler.TryGetObject(handle, out value))
            {
                DataObject1 data = (DataObject1)value;
                return(data.Value);
            }
            // No object for the handle ...
            return("!!! INVALID HANDLE");
        }
Пример #2
0
        public IHasRowVersion ProcessRequest(string objectType, object[] parameters)
        {
            switch (objectType)
            {
                case "DataObject1":
                    // Do query against the back-end, using parameters
                    var result = new DataObject1
                    {
                        Code = (string)parameters[0],
                        DateTime = DateTime.Now,
                        Value = rand.Next(5, 50),
                        RowVersion = 123

                    };
                    return result;
                case "DataObject2":
                        // Do something
                    return null;
                default:
                    throw new ArgumentException("objectType");
            }
            
        }
Пример #3
0
        public IHasRowVersion ProcessRequest(string objectType, object[] parameters)
        {
            switch (objectType)
            {
            case "DataObject1":
                // Do query against the back-end, using parameters
                var result = new DataObject1
                {
                    Code       = (string)parameters[0],
                    DateTime   = DateTime.Now,
                    Value      = rand.Next(5, 50),
                    RowVersion = 123
                };
                return(result);

            case "DataObject2":
                // Do something
                return(null);

            default:
                throw new ArgumentException("objectType");
            }
        }