Automapper-从列表项属性映射到int列表

时间:2019-02-20 01:19:07

标签: entity-framework .net-core automapper

将.NET Core与EF和Automapper结合使用。如何将列表项的属性映射到与该属性相同类型的列表?

我想将SELECT A.PK_USER_TIME_LOG_ID, A.PROJECT_ID, A.CLIENT_ID, A.USER_ID, A.UTL_DTSTAMP, A.UTL_LATITUDE, A.UTL_LONGITUDE, A.UTL_EVENT, A.UTL_TASK, A.UTL_DESCRIPTION, /* DURATION in seconds */ TIMESTAMPDIFF(SECOND, A.UTL_DTSTAMP, B.UTL_DTSTAMP) AS UTL_DURATION FROM tbl_user_time_log A INNER JOIN tbl_user_time_log B ON B.PK_USER_TIME_LOG_ID = ( A.PK_USER_TIME_LOG_ID + 1 ) WHERE A.USER_ID = '465605' AND DATE(A.UTL_DTSTAMP) = CURDATE() AND A.UTL_EVENT <> 'CLOCK OUT' ORDER BY A.UTL_DTSTAMP DESC; 中每个information technology的{​​{1}}映射到我的info = soup.select_one('[href*="sectors_in"]') print(info.text) 的{​​{1}}

地址类别

Information Technology

AddressDTO类

int JobId

工作班

Job

AddressController Automapper Config(这是我实现魔力的地方,但是下面是我现在拥有的东西)

Address.JobHistory

1 个答案:

答案 0 :(得分:0)

看起来我需要使用Custom Type Converter并提供自己的方法来进行转换。