Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / webapi complex type and custom binding / 1 сообщений из 1, страница 1 из 1
23.09.2015, 18:10
    #39059717
sergei64_89
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
webapi complex type and custom binding
Код: c#
1.
2.
3.
[HttpPost]
        public ResultBase<ResultEnum> EditRate(RateCurrencyModel rate )
......


Код: c#
1.
2.
3.
4.
5.
6.
 public class RateCurrencyModel
    {
        public int Id { get; set; }
        public int CurrencyId { get; set; }
        public DateTime Date { get; set; }
}


По ajax отправляется Date='12.08.2015', на сервере получает Date='01.01.0001 0:00:00'. В mvc я использую
Код: c#
1.
2.
3.
      
System.Web.Mvc.ModelBinders.Binders.Add( typeof( DateTime ), new DateTimeModelBinder() );
System.Web.Mvc.ModelBinders.Binders.Add( typeof( DateTime? ), new DateTimeModelBinder() );


Как это делается в web api?
...
Рейтинг: 0 / 0
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / webapi complex type and custom binding / 1 сообщений из 1, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]