public List <CarDTO> List() { using (CarRentalEntities context = new CarRentalEntities()) { var cars = context.usp_Car_List().ToList(); return(carMapping.MapToListCarDTO(cars)); } }
public UserDTO MapToUserDTO(User user) { return(new UserDTO { Car = carMapping.MapToListCarDTO(user.Car.ToList()), Company = user.Company, Job = user.Job, Email = user.Email, Firstname = user.Firstname, Id = user.Id, Is_Active = user.is_Active, Is_Address_Private = user.is_Address_Private, Lastname = user.Lastname, Note = user.Note, Password = user.Password, Phone_Number = user.Phone_Number, Role = user.Role, UserBooking = user.UserBooking, user_address = user.user_address }); }