Hello I 'm trying to build an WebAPI using version 5 of LLBLGen .
I was having problems with serialization in JSON especially in POST .. so I tried to create DTO for my entity
I had never done and I remained surprised by how easy it is to do it from your designer..Compliments!
I would like to know which is the best way to convert DTO objects EntityClass , both individual objects is List of DTO in List < Entity > and vice versa .
I could not find the API to make a cast safe and fast ..
The DTO I want to turn are derived from the Entities should be able to cast a safe?
I saw on the forum that someone solved by copying the fields one at a time .. I hope there is a solution more efficient ..
Thanks for your help.
public void Post([FromBody]JToken jsonBody)
{
List<Dtocustomers> customers = new List<Dtocustomers>();
customers = (List<Dtocustomers>)JsonConvert.DeserializeObject(MyJonsonBoby, typeof(List<Dtocustomers>));//Working Ok
using (var adapter = new DataAccessAdapter())
{
???
How do I turn List < DTOCustomer > in List < CustomerEntity >
adapter.SaveCollection(CustomerEntity );
}
}