I have a 3-tiered application
DAL has EDMX file that EF6 generated it automatically from database (DB First mode). I have BLL and UL layers too.
But, when I want to use BLL methods in UI, I must add DAL assembly to UI layer (because of return types of methods)
List<Person>
Person define in EDMX (DAL)] (this my problem)
How I can separate classes (DTO) from EDMX file and create as separate assembly?
How can I prevent adding DAL Assembly (whole EDMX) to the UI layer?
Good question, the accepted wisdom is that you define a different Person for each tier/layer (DAL, BLL and UI) and then write code to map between each layer. There's AutoMapper which can make life easier.
Now consider a real-life application with 100 to 1,000 entities. This pattern does not scale well.
I suggest using the Code First approach to EF. And passing the same object between all your layers.