Как сопоставить строку с датой в automapper?

У меня есть строка, которая является действительной датой, но это строка, и она должна быть строка. Однако, когда я пытаюсь автоматически сопоставить его с датой и временем, он выдает исключение

Trying to map System.String to System.DateTime.

Trying to map System.String to System.DateTime.
Using mapping configuration for ViewModels.FormViewModel to Framework.Domain.Test
Destination property: DueDate
Missing type map configuration or unsupported mapping.
Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: AutoMapper.AutoMapperMappingException: Trying to map System.String to System.DateTime.
Using mapping configuration for ViewModels.FormViewModel to 
Framework.Domain.Task
Destination property: DueDate
Missing type map configuration or unsupported mapping.
Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.

, я бы надеялся, что он выполнит автоматическое преобразование, но я думаю, что должен рассказать ему, как это сделать.

Как я могу сказать это преобразовать?

7
задан JYL 2 September 2014 в 13:35
поделиться