Exemplo n.º 1
0
 public Task <PersonDetailsRecord> Handle(GetPersonDetails query)
 {
     using (var connection = new MySqlConnection(connectionString))
     {
         return(connection.QuerySingleAsync <PersonDetailsRecord>(
                    "select * from PersonDetails where id = @id",
                    new { id = query.Id }));
     }
 }
Exemplo n.º 2
0
        private async Task Handle(GetPersonDetails query)
        {
            using (var connection = new MySqlConnection(connectionString))
            {
                var result = await connection.QuerySingleAsync <PersonDetailsRecord>(
                    "select * from PersonDetails where id = @id",
                    new { id = query.Id });

                Sender.Tell(result, Self);
            }
        }