예제 #1
0
        public IEnumerable <UserView> GetUsers()
        {
            var users = _repo.FindAll(i => i.Addresses).ToList();

            var usersView = from user in users
                            select DomainToViewMaps.UserToView(user);

            return(usersView);
        }
예제 #2
0
        public UserView AddUser(UserView user)
        {
            User domainUser = DomainToViewMaps.UserViewToDomain(user);

            domainUser = _repo.Insert(domainUser);

            user = DomainToViewMaps.UserToView(domainUser);

            return(user);
        }
예제 #3
0
        public AddressInfoView AddAddressBook(AddressInfoView address)
        {
            AddressInfo domainAddress = DomainToViewMaps.AddressInfoViewToDomain(address);

            domainAddress = _repo.Insert(domainAddress);

            address = DomainToViewMaps.AddressToView(domainAddress);

            return(address);
        }