コード例 #1
0
        public User Delete(int id)
        {
            var translator = new UserTranslator();
            var user       = this.userService.Delete(id);

            return(translator.ToViewModel(user));
        }
コード例 #2
0
        public User Delete(User model)
        {
            var translator = new UserTranslator();
            var user       = this.userService.Delete(translator.ToDto(model));

            return(translator.ToViewModel(user));
        }
コード例 #3
0
        public User Get(int id)
        {
            var translator = new UserTranslator();
            var userDto    = this.userService.Get(id);

            return(translator.ToViewModel(userDto));
        }
コード例 #4
0
        public User[] GetAll()
        {
            var translator = new UserTranslator();
            var usersDto   = this.userService.GetAll();

            var users = new List <User>();

            usersDto.ToList().ForEach(p => users.Add(translator.ToViewModel(p)));

            return(users.ToArray());
        }