-
-
Save Ershad95/1e42d259ed1461088dcb91f4424e54a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[HttpGet] | |
public async IAsyncEnumerable<Customer> Get() | |
{ | |
while (_customers.Any(_ => _.Key % 10 == 0)) | |
{ | |
var customer = _customers.First(_ => _.Key % 10 == 0); | |
yield return new Customer(customer.Value.Name, customer.Key); | |
_customers.Remove(customer); | |
await Task.Delay(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment