Ejemplo n.º 1
0
        private IEnumerable <Conditional> GetConditionals(ModelId modelId, IViewModel viewModel)
        {
            var conditionals = new List <Conditional>();

            MethodInfo[] methods = viewModel.GetType().GetMethods();
            foreach (MethodInfo method in methods)
            {
                if (TryGetAttribute(method, out ConditionalAttribute attribute))
                {
                    conditionals.Add(_entityBuilder.BuildConditional(method.Name, modelId, attribute));
                }
            }
            return(conditionals);
        }