Пример #1
0
        public async Task <Model.UserActivityAlbum> InsertActivityAlbum(int id, UserActivityAlbumInsertRequest request)
        {
            var entity = _mapper.Map <Database.UserActivityAlbum>(request);

            entity.UserID = id;

            await _context.UserActivityAlbums.AddAsync(entity);

            await _context.SaveChangesAsync();

            return(_mapper.Map <Model.UserActivityAlbum>(entity));
        }
        private async void Album_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var albumVM = (e.SelectedItem as AlbumViewModel);
            await Navigation.PushAsync(new AlbumDetailsPage(albumVM.Album));

            var request = new UserActivityAlbumInsertRequest()
            {
                AlbumID      = albumVM.Album.ID,
                InteractedAt = DateTime.Now
            };
            await _loggingService.InsertActivityAlbum(SignedInUserHelper.User.ID, request);
        }
 public async Task <UserActivityAlbum> InsertActivityAlbum(int id, [FromBody] UserActivityAlbumInsertRequest request)
 {
     return(await _service.InsertActivityAlbum(id, request));
 }