Пример #1
0
        public async Task UpdateUserNames([FromBody] UpdateNamesInput input)
        {
            var user = await UserExtractor.ProvideUserAsync();

            await Transaction.ActionAsync(() =>
            {
                user.FirstName = input.FirstName;
                user.LastName  = input.LastName;
            });
        }
Пример #2
0
        public async Task <IEnumerable <ReservationsOutput> > GetCurrentUserReservations(
            [FromServices] GetAllReservationsQuery query,
            [FromQuery] ReservationsFilter filter
            )
        {
            var currentUser = await UserExtractor.ProvideUserAsync();

            filter.UserId = currentUser.Id;

            return(await query.ExecuteAsync(filter));
        }
Пример #3
0
        public async Task UpdateUserAvatar([FromBody] UpdateAvatarInput input)
        {
            var user = await UserExtractor.ProvideUserAsync();

            await Transaction.ActionAsync(() => user.Avatar = input.Avatar);
        }
Пример #4
0
 public async Task <ProfileOutput> GetProfile()
 {
     return(new ProfileOutput(await UserExtractor.ProvideUserAsync()));
 }