示例#1
0
        public async Task <IActionResult> Get()
        {
            var user = await _user.GetCurrentUserAsync();

            var s = await _tag.GetByUserAsync(user);

            return(Ok(s.Select(c => new TagVM
            {
                Id = c.Id,
                Onvan = c.Onvan
            }).ToList()));
        }
示例#2
0
        public async Task <IActionResult> GetUserInfo()
        {
            var claimsIdentity = User.Identity as ClaimsIdentity;
            // var q = _zirreshteh.GetByUser(_usersService.GetCurrentUserId());
            var q = await _Tags.GetByUserAsync(await _usersService.GetCurrentUserAsync());

            // var q = _Tags.GetByUser(_usersService.GetCurrentUserId());
            if (q != null)
            {
                return(Json(new
                {
                    Username = claimsIdentity.Name,
                    Tags = q
                }));
            }
            return(Json(new
            {
                Username = claimsIdentity.Name,
                Tags = " "
            }));
        }