Exemplo n.º 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");
        }
Exemplo n.º 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");
            }
            
        }
Exemplo n.º 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");
            }
        }