public async Task UpdateUserNames([FromBody] UpdateNamesInput input)
        {
            var user = await UserExtractor.ProvideUserAsync();

            await Transaction.ActionAsync(() =>
            {
                user.FirstName = input.FirstName;
                user.LastName  = input.LastName;
            });
        }
        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 ExtractTwitterListMembersAsync(string twitterListUrl)
        {
            List <UserProfile> profiles = new List <UserProfile>();

            var extractor = new UserExtractor(new HttpClient());
            await extractor.ExtractTwitterListMembersAsync(
                new TwitterListExecutionInfo
            {
                TwitterListUrl = twitterListUrl
            },
                canExecute : () => profiles.Count <= 20,
                onUsersExtracted : results => profiles.AddRange(results));

            foreach (var t in profiles)
            {
                log.WriteLine(t.ToString());
            }

            Assert.NotEmpty(profiles);
        }
示例#4
0
 public UserAwareActionFilter(UserExtractor userExtractor)
 {
     UserExtractor = userExtractor;
 }
        public async Task UpdateUserAvatar([FromBody] UpdateAvatarInput input)
        {
            var user = await UserExtractor.ProvideUserAsync();

            await Transaction.ActionAsync(() => user.Avatar = input.Avatar);
        }
 public async Task <ProfileOutput> GetProfile()
 {
     return(new ProfileOutput(await UserExtractor.ProvideUserAsync()));
 }
 public ProfileController(UserExtractor userExtractor, TransactionFacade transaction)
 {
     UserExtractor = userExtractor;
     Transaction   = transaction;
 }