Aaltuj / VxFormGenerator

The library contains a component, that nests itself into the Blazor EditForm instead of a wrapper around the EditForm. The component is able to generate a form based on a POCO or a ExpandoObject. Because of this architecture the library provides the developer flexibility and direct usage of the EditForm.
MIT License
119 stars 36 forks source link

Fix Nullable Types #4

Closed tkettani closed 4 years ago

tkettani commented 4 years ago

my apologies if i messed anything up this is my first pull request ever. this is related to issue #3

with this fix we can now have this declaration with no visible errors and the form is behaving in a similar way to non nullable types:

       public FormGeneratorComponentsRepository BootstrapFormMapping = new FormGeneratorComponentsRepository(
            new Dictionary<string, Type>()
            {
                {typeof(string                                              ).ToString(), typeof(BootstrapInputText)                },

                {typeof(DateTime?                                           ).ToString(), typeof(InputDate<DateTime?>)                       },
                {typeof(bool?                                               ).ToString(), typeof(BootstrapInputCheckbox<bool?>)            },
                {typeof(decimal?                                            ).ToString(), typeof(BootstrapInputNumber<decimal?>)            },
                {typeof(Int32?                                              ).ToString(), typeof(BootstrapInputNumber<Int32?>)            },
                {typeof(Int64?                                              ).ToString(), typeof(BootstrapInputNumber<Int64?>)            },
                {typeof(float?                                              ).ToString(), typeof(BootstrapInputNumber<float?>)            },
                {typeof(double?                                             ).ToString(), typeof(BootstrapInputNumber<double?>)            },

            }, null, typeof(BootstrapFormElement<>));