public async Task AddAsync(Order order)
        {
            using var dbContext = new WebApiContext();
            await dbContext.Orders.AddAsync(order);

            await dbContext.SaveChangesAsync();
        }
 public IEnumerable <Order> ReadAll()
 {
     using var dbContext = new WebApiContext();
     return(dbContext.Orders);
 }
 public async Task <Order> GetByIdAsync(int id)
 {
     using var dbContext = new WebApiContext();
     return(await dbContext.Orders.FindAsync(id));
 }