This commit is contained in:
qianhao.xu
2025-02-21 13:04:44 +08:00
parent f80aca492c
commit 218a1ce86a
8 changed files with 191 additions and 95 deletions

View File

@@ -0,0 +1,15 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System;
public class LocalDateModelBinderProvider : IModelBinderProvider
{
public IModelBinder GetBinder(ModelBinderProviderContext context)
{
if (context.Metadata.ModelType == typeof(DateTime))
{
return new LocalDateModelBinder();
}
return null;
}
}