Skip to main content
edited body
Source Link
SymboLinker
  • 1.3k
  • 10
  • 18

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasksTasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await Tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

deleted 2 characters in body
Source Link
SymboLinker
  • 1.3k
  • 10
  • 18

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interesestedinterested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interesested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.

Source Link
SymboLinker
  • 1.3k
  • 10
  • 18

While writing a compiler I became interested in syntax for awaiting multiple tasks (and getting their values).

For example:

var (employees, books) = await [ dbConnection.GetAllAsync<Employee>(), dbConnection.GetAllAsync<Book>(), ]; 

Then I realized that the following syntax, almost identical, is already possible in C#:

var (books, employees) = await tasks( dbConnection.GetAllAsync<Books>(), dbConnection.GetAllAsync<Employees>()); 

If you're interesested, see the NuGet package AwaitMultiple. It can be used like this up to 16 arguments.