public Task <IEnumerable <PersonListItemRecord> > Handle(GetPersonList query) { using (var connection = new MySqlConnection(connectionString)) { return(connection.QueryAsync <PersonListItemRecord>("select * from PersonList")); } }
public async Task <IEnumerable <PersonListItemRecord> > Handle(GetPersonList query, CancellationToken cancellationToken = default) { await using var connection = new MySqlConnection(Program.ConnectionString); return(await connection.QueryAllAsync <PersonListItemRecord>( "PersonList", cancellationToken : cancellationToken, trace : NullLogger <ITrace> .Instance)); }
private async Task Handle(GetPersonList query) { using (var connection = new MySqlConnection(connectionString)) { var result = await connection.QueryAsync <PersonListItemRecord>( "select * from PersonList" ); Sender.Tell(result, Self); } }
public Task <IEnumerable <Person> > Handle(GetPersonList request, CancellationToken cancellationToken) { var ctr = this.context.Persons.AsQueryable(); return(Task.FromResult(ctr.AsEnumerable <Person>())); }