Skip to content

Instantly share code, notes, and snippets.

@Ershad95

Ershad95/apis.cs Secret

Created January 28, 2023 04:59
[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