0
bilalhaidar created
Hi, While digging into the AbpFramework I saw the class below. Is this the place where DateTime properties coming from client are normalized to the current Clock Provider?
public class AbpApiDateTimeBinder : IModelBinder
{
public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
{
var value = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
var date = value?.ConvertTo(typeof(DateTime?), CultureInfo.CurrentCulture) as DateTime?;
if (date != null)
{
bindingContext.Model = Clock.Normalize(date.Value);
}
return true;
}
}
2 Answer(s)
-
0
Hi,
This is for WebApi, there are two more places,
For MVC: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Mvc/Web/Mvc/ModelBinding/Binders/AbpMvcDateTimeBinder.cs">https://github.com/aspnetboilerplate/as ... eBinder.cs</a>
For AspNet Core: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Mvc/ModelBinding/AbpDateTimeModelBinder.cs">https://github.com/aspnetboilerplate/as ... lBinder.cs</a>
-
0
Thanks a lot :D