Пример #1
0
        public async Task <IActionResult> GetMyProfile()
        {
            var user = await _userManager.GetUserAsync(HttpContext.User);

            var animes = await _DB.UserAnimeInfos.Where(infos => infos.Users.Equals(user))
                         .Include(infos => infos.SubAnime)
                         .ToListAsync();

            WeekSwitch Switch    = new WeekSwitch();
            var        AnimeList = Switch.SwitchAnimeByStats(animes);

            return(View("Profile", new Views.Profile.Model.Profile
            {
                Users = user,
                IsMe = true,
                AnimeInfos = AnimeList
            }));
        }
Пример #2
0
        public async Task <IActionResult> GetIndex(string uid)
        {
            var user = await _userManager.FindByIdAsync(uid);

            var animes = await _DB.UserAnimeInfos.Where(infos => infos.Users.Equals(user))
                         .Include(infos => infos.SubAnime)
                         .ToListAsync();

            WeekSwitch Switch    = new WeekSwitch();
            var        AnimeList = Switch.SwitchAnimeByStats(animes);

            return(View("Profile", new Views.Profile.Model.Profile
            {
                Users = user,
                IsMe = false,
                AnimeInfos = AnimeList
            }));
        }