How to transfer data from a repository (EF)?

I have the repository UserRepository, which reads data from DB using EntityFramework and a service class UserService, which accesses the repository. And our UI already refers to this service.

Let's say the domain model
class User { string Name {get; set; }}

How to give data? Is in the form of domain models?

Come to mind the options:

1. Make another class UserModel (UserDto?), in which I only need the fields in the method repository (or service) to convert the domain model (a simple reproduction of the field values). Alternatively, rather than copying the data UserModel may be a descendant of the User (what problems will cause?)

2. To give the domain model, but first detach it from the context.
July 9th 19 at 13:29
1 answer
July 9th 19 at 13:31
Thin-client thin data. Copy.

Find more questions by tags C#Entity Framework