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)); }
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); }
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; }