Esempio n. 1
0
        public List<SongViewModel> GetSongVk(string userId, VkUserModel model)
        {
            var audioService = new VkAudioService(model.Login, model.Password);
            var result = new List<SongViewModel>();
            var songs = audioService.GetSongs(model.FindLyrics).ToList();
            if (songs.Any())
            {
                _userRepository.UpdateUserVkInfo(userId, model.Login, model.Password);
            }
            result.AddRange(songs.Select(ModelConverters.ToSongFromVk));

            return result;
        }
Esempio n. 2
0
        public JsonResult UpdateUserVkInfo(VkUserModel userInfo)
        {
            var userId = User.Identity.GetUserId();
            _userService.UpdateUserVkInfo(userId, userInfo.Login, userInfo.Password);

            return Json(new { Succes = true }, JsonRequestBehavior.AllowGet);
        }