Esempio n. 1
0
        public IStatementDesigner <THost, TData> Post <TData>(Func <IPaperContext, THost, IEntity, TData> dataFactory)
        {
            if (postStatementFactory != null)
            {
                throw new InvalidOperationException("Já existe uma sintaxe declarada para processamento de requisições do tipo GET.");
            }

            var builder = new StatementDesigner <THost, TData>(hostFactory, dataFactory);

            postStatementFactory = () => builder.DesignStatement();

            return(builder);
        }
Esempio n. 2
0
        public IStatementDesigner <THost, TData> Get <TData>(Func <IPaperContext, THost, TData> dataFactory)
        {
            if (getStatementFactory != null)
            {
                throw new InvalidOperationException("Já existe uma sintaxe declarada para processamento de requisições do tipo GET.");
            }

            var builder = new StatementDesigner <THost, TData>(hostFactory,
                                                               (ctx, host, formData) => dataFactory.Invoke(ctx, host)
                                                               );

            getStatementFactory = () => builder.DesignStatement();

            return(builder);
        }