Factory object mappings - LBHackney-IT/lbh-base-api GitHub Wiki
The EntityFactory.cs and ResponseFactory.cs classes provide mapping functions between objects. You can then call this class whenever you require this mapping, keeping your classes which hold logic tidier and clearer.
If the mapping functions are tested in isolation then they can be used in tests as well so you don't have to write out the mapping in your tests, also keeping them tidier.
-
EntityFactory.csmaps fields from the database entities defined the database context to fields in your domain object. This method should be tested inEntityFactoryTest.cs. -
ResponseFactory.csmaps fields in your domain object to the response object and should be tested inResponseFactoryTest.cs.