I have multiple data transfer objects that need their data transferred over to their DAL equivalent models.
Is there a generic binding function or class that I can use in C# to do so? I have searched but to no avail. At the moment I am manually creating the new DAL objects and setting the equivalent properties from the DTO data. Very time consuming, especially as my domain grows.
Thanks, any help/tips would be ace.
I strongly recommend Automapper 🙂
It’s a .net tool you can use to easily map between objects; you can add custom rules if the properties of your objects have different names, or if you need some special processing, but for simple objects it works out of the box!