1
This commit is contained in:
15
DOAN.ServiceCore/ModelBinder/LocalDateModelBinderProvider.cs
Normal file
15
DOAN.ServiceCore/ModelBinder/LocalDateModelBinderProvider.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user