示例#1
0
        private NativePhraseEvaluator CreateActionSemantic(Action action, string actionName)
        {
            var nativeCallWrapperId             = "%" + actionName;
            NativeCallWrapper nativeCallWrapper = i =>
            {
                action();
                return(null);
            };

            _nativeCallWrappers.Add(nativeCallWrapperId, nativeCallWrapper);

            return(c =>
            {
                var callEntity = DbConstraint.Entity(nativeCallWrapperId);
                return callEntity;
            });
        }
示例#2
0
        private NativePhraseEvaluator CreateActionSemantic(Action <DbConstraint> action, string actionName, string parameterName1)
        {
            var nativeCallWrapperId             = "%" + actionName;
            NativeCallWrapper nativeCallWrapper = i =>
            {
                var argumentEntity1 = i.GetSubjectConstraint(parameterName1);
                action(argumentEntity1);
                return(null);
            };

            _nativeCallWrappers.Add(nativeCallWrapperId, nativeCallWrapper);

            return(c =>
            {
                var callEntity = DbConstraint.Entity(nativeCallWrapperId);
                return callEntity
                .ExtendByAnswer(parameterName1, c[parameterName1])
                ;
            });
        }
示例#3
0
        private NativePhraseEvaluator CreateActionSemantic(Action <string, string> action, ParameterEvaluator param1, ParameterEvaluator param2, string actionName, string parameterName1, string parameterName2)
        {
            var nativeCallWrapperId             = "%" + actionName;
            NativeCallWrapper nativeCallWrapper = i =>
            {
                var argumentEntity1 = i.GetSubjectConstraint(parameterName1);
                var argumentEntity2 = i.GetSubjectConstraint(parameterName2);
                action(argumentEntity1.PhraseConstraint, argumentEntity2.PhraseConstraint);
                return(null);
            };

            _nativeCallWrappers.Add(nativeCallWrapperId, nativeCallWrapper);

            return(c =>
            {
                var callEntity = DbConstraint.Entity(nativeCallWrapperId);
                return callEntity
                .ExtendByAnswer(parameterName1, param1(parameterName1, c))
                .ExtendByAnswer(parameterName2, param2(parameterName2, c))
                ;
            });
        }