15 lines
362 B
C#
15 lines
362 B
C#
|
|
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;
|
|||
|
|
}
|
|||
|
|
}
|