Ejemplo n.º 1
0
        public IEnumerable <IConditionResolver> GetResolvers(MemberMetaInfo member, IThrowCollection throwCollection)
        {
            var ignoreIf    = GetResolvers <IgnoreIfAttribute>(member, isInverted: false);
            var ignoreIfNot = GetResolvers <IgnoreIfNotAttribute>(member, isInverted: true);

            return(ignoreIf.Concat(ignoreIfNot));
        }
        public string GetMethodBody(string methodId, IChainMethodArgsProvider provider, IComponentProvider components, IThrowCollection throwCollection)
        {
            var node = new CodeNodeBuilder();

            node.If($"{IsInvert()}({GetConditionString(provider)})", node => {
                node.Return(provider.InvokeNextMethod());
            });
            node.Return(DeserializeResult.Success.ToDisplayString());

            return(node.ToString());

            string IsInvert() => _isInverted ? "!" : "";
        }