public List<CustomerModel> GetAll() { List<CustomerModel> customers = new List<CustomerModel>(); db.Customers.ToList().ForEach(customer => { customers.Add(new CustomerModel() { CustomerId = customer.CustomerId, FirstName = customer.FirstName, LastName = customer.LastName, Address = customer.Address, CreatedAt = customer.CreatedAt }); }); return customers; } public async Task<List<CustomerModel>> GetAllAsync() { return await Task.Run((Func<List<CustomerModel>>)GetAll); } public Task<List<CustomerModel>> GetAllTask() { return new Task<List<CustomerModel>>(GetAll); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)