Ejemplo n.º 1
0
        public static void AddFields <TSourceType>(this ModelConventionInputType <TSourceType> modelConventionInputType)
        {
            var modelConvention = new ModelConvention <TSourceType>();

            modelConventionInputType.Name = $"{modelConvention.Name}Input";
            modelConvention.ForEachWithField(
                (type, name, desc, resolve) => modelConventionInputType.Field(type, name, desc, resolve: resolve), true);
        }
Ejemplo n.º 2
0
        public static void AddFields <TSourceType>(this ModelConventionType <TSourceType> modelConventionType)
        {
            var modelConvention = new ModelConvention <TSourceType>();

            modelConventionType.Name = modelConvention.Name;

            if (typeof(TSourceType).GetCustomAttribute(
                    typeof(DescriptionAttribute)) is DescriptionAttribute descAttr)
            {
                modelConventionType.Description = descAttr.Description;
            }

            modelConvention.ForEachWithField(
                (type, name, desc, resolve) => modelConventionType.Field(type, name, desc, resolve: resolve), false);
        }