BL Mapping help
I have finished my BL DTO's and want to map my DTO with the EF DAL
How do I map it when inside the create DTO is a another CreateDTO?
https://pastebin.com/8hmUZ2Ay
Pastebin
Code - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
13 Replies
Do u use Mapster or AutoMapper?
Automapper is generally not recommended. It's very easy for things to go wrong
I usually just map by hand unless I've got some cross cutting mapping concern I want enforced
That’s why I’m asking
Some people just do a ToDTO, FromDTO in the DAL object. Others use mapping classes. Being consistent is more important here imho
Make an extension method for this class and then u are good to go
That's another option for certain
Consistency is key
Mapperly
Im pretty sure u can define specific mapping options for the object
The thing is i don't have much experience with mapping and DTO's
Should I ignore it or Map it? The child DTO is the question since I have everything required since I had imagined it worked that way
I have to define(map) the whole create dto if that scenario happends or can I just opt to ignore it
from what i see it should be handle. Here is a pic. from maperly how u create a mapper:

Ohh okay I thought directly using [MapProperty]
I want front end DTOs to be as flat as possible
Should I just put raw EF entities instead of CreateDto's?
The logic I wanted to concieve:
The waiter (role we getting from auth) opens up a table it will create using this DTO
He can Directly order items(polozky) on the specified table Id .
And the Action will be created immediately because I track Opening tables too.
The Entity I am refering to:
But when I use the CreateDto's I need to specify their Entity too (making sense that I would need it to specify) But that seems to me like Service rather than Mapping as a whole