Пример #1
0
        public override Task <ViewUserResponse> ViewAutenticatedUsers(EmptyInput request, ServerCallContext context)
        {
            var users = _userRepository.GetAutenticatedUsers().ToList();

            var result = new ViewUserResponse();

            users.ForEach((e) =>
            {
                result.Results.Add(new UserResponse()
                {
                    Email         = e.Email,
                    Name          = e.Name,
                    LastConnected = e.LastConnection.ToString(),
                });
            });

            return(Task.FromResult(result));
        }
Пример #2
0
        public override Task <ViewPhotoResponse> ViewPhotos(EmptyInput request, ServerCallContext context)
        {
            var photos = _photoRepository.GetPhotos();

            var result = new ViewPhotoResponse();

            photos.ForEach((e) =>
            {
                result.Results.Add(new PhotoResponse()
                {
                    Email     = e.User.Email,
                    NamePhoto = e.Name,
                    IdPhoto   = e.Id,
                    Extension = e.Extension,
                    FileSize  = e.FileSize,
                });
            });

            return(Task.FromResult(result));
        }