Exemplo n.º 1
0
        public async Task <IActionResult> Get()
        {
            var activities = await _repository
                             .BrowseAsync(Guid.Parse(User.Identity.Name));

            return(Json(activities.Select(x => new { x.Id, x.Name, x.Category, x.CreatedAt })));
        }
        public async Task <IActionResult> Get()
        {
            Console.WriteLine("CUID: " + CurrentUserId());
            Console.WriteLine("User.Identity: " + User.Identity);
            Console.WriteLine("User.Identity.Name: " + User.Identity.Name);
            var activities = await _activityRepository.BrowseAsync(CurrentUserId());

            return(Json(activities.Select(x => new { x.Id, x.Name, x.Category, x.CreatedAt })));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Get()
        {
            var userId = Guid.Parse(User.Identity.Name);

            Console.WriteLine(userId.ToString());
            var activities = await _activityRepository.BrowseAsync(userId);

            return(Ok(activities));
        }
Exemplo n.º 4
0
 public async Task <IEnumerable <ActivityDto> > GetActivitiesAsync(Guid userId)
 {
     return(((IEnumerable <Activity>) await _activityRepository.BrowseAsync((Guid)userId))
            .Select(x => new ActivityDto {
         Id = x.Id,
         UserId = x.UserId,
         Name = x.Name,
         Category = x.Category,
         CreatedAt = x.CreatedAt
     }));
 }
Exemplo n.º 5
0
        public async Task <IActionResult> Get()
        {
            var activities = await _activityRepository
                             .BrowseAsync(GetCurrentUser());

            return(Json(activities.Select(x => new
            {
                x.Id,
                x.Name,
                x.Category,
                x.CreateAt
            })));
        }
Exemplo n.º 6
0
 public async Task <IActionResult> Get()
 => Ok(await activityRepository.BrowseAsync(User.Identity.GetUserIdIfExist()));