示例#1
0
 public Task <IEnumerable <PersonListItemRecord> > Handle(GetPersonList query)
 {
     using (var connection = new MySqlConnection(connectionString))
     {
         return(connection.QueryAsync <PersonListItemRecord>("select * from PersonList"));
     }
 }
示例#2
0
 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));
 }
示例#3
0
        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>()));
        }