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;
}
}
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
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>
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks a lot :D
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)