public IActionResult ArtistDetails(int Id) { var model = new ArtistDetailsViewModel(); model.Artist = _artistsManager.GetOne(x => x.Id == Id, includeProperties: $"{nameof(Artist.User)},{nameof(Artist.Songs)},{nameof(Artist.Follows)}.{nameof(Follow.Follower)}"); model.PagingModelSongs = new PagingModel <Song>() { PagingList = model.Artist.Songs.Take(MBoxConstants.initialTakeHomeLists).ToList() }; model.CurrentLoggedUserId = CurrentLoggedUserId; model.FollowingCount = _userManager.Users.Where(x => x.Id == Id).Include($"{nameof(Artist.Follows)}.{nameof(Follow.Artist)}").FirstOrDefault().Follows.Select(x => x.Artist == model.Artist).ToList().Count; model.FollowersCount = model.Artist.Follows.Select(x => x.Follower).ToList().Count; return(View(model)); }
public IActionResult MyAccount() { var artist = _artistManager.GetOne(filter: x => x.Id == CurrentLoggedUserId, includeProperties: $"{nameof(Artist.User)},{nameof(Artist.Follows)}.{nameof(Follow.Follower)}"); var model = new MyAccountViewModel(); model.ArtistBio = artist.Bio; model.Name = artist.User.Name; model.Picture = artist.PictureName; model.FollowingCount = _userManager.Users.Where(x => x.Id == CurrentLoggedUserId).Include($"{nameof(Artist.Follows)}.{nameof(Follow.Artist)}").FirstOrDefault().Follows.Select(x => x.Artist == artist).ToList().Count; model.FollowersCount = artist.Follows.Select(x => x.Follower).ToList().Count; return(View(model)); }