Converter

Sep 5, 2011 at 2:18 PM

Hi!

I have a DTO and a LinqToSql (LTS) object. But my LTS object has properties with an underscore, such as "cod_people" and in my DTO, I made "CodPeople". 

Is it possible to create a converter to macth these differences?

Thanks!

Coordinator
Sep 6, 2011 at 7:18 PM

I am not sure if I follow you entirely. A converter is used to convert between two different types, like converting from a string to an int.

With the problem you describe here, you can always set up the mapping manually. Something like this:

{code:c#}

mapping = new Mapping<DTOPerson, LTSPerson>();

mapping.Relate(dtoperson => dtoperson.CodPeople, ltsperson => ltsperson.cod_people);

{code:c#}

Does that answer the question?

.Tore