Exemplo n.º 1
0
        public FactoryEventArgs(ServiceEventArgs e)
        {
            // Minimal required parameters for framework
            Id = e.Id;
            FactoryName = e.FactoryName;
            ServiceEventType = e.ServiceEventType;

            // Optional parameters for POST and PUT
            ServiceParameter = e.ServiceParameter;
        }
Exemplo n.º 2
0
        public ServiceResult Put(string id, [FromBody]ServiceParameter para)
        {
            var args = new ServiceEventArgs(ServiceEventType.Put, para, id);

            // Transfer service event args into factory event args
            // so that it can use it to determine which implementation 
            // to return for the factory and processor.
            var factoryArgs = new FactoryEventArgs(args);
            var factory = _factory.GetFactory(this, factoryArgs);
            var processor = factory.GetConcrete();

            // Execute the process
            var serviceResult = processor.Execute<ServiceResult>(this, args);
            return serviceResult;
        }