Error Mapping Types

77 views
Skip to first unread message

Alan Quadros

unread,
Apr 29, 2022, 3:18:54 PMApr 29
to AutoMapper-users
Dear all, 

I'm in trouble with AutoMapper

I have 2 classes:

public class ActionDto {
         public long Id {get;set;}
         public string Title {get;set;}
         public EndDate EndDate;
}

public class Action {`
        public long Id {get;set;}
        public string Title {get;set;}
        public ICollection<EndDate> PossibleEndDates;
}

public class EndDate {
       public long Id {get;set;}
       public string User {get;set;}
       public DateTime DateReference {get;set;}
}

When i try to insert new ActionDto using front end... it sends to the API one object with... Id, Title and only One End Date, i need to map... the unique EndDate to the first position of EndDates Array... how can i do that !? 


Reply all
Reply to author
Forward
0 new messages