Guest User

Guest User

  • Tech Writer
  • 98
  • 42.4k

Save Range of models

Jan 23 2021 7:04 AM
How can I save a list of products  in entityframework? 
this code doesnt work for me..
 
public async Task<Guid> CreateRangeAsync(List<ProductModel> models)
{
await _context.Products.AddRangeAsync( models);
await _context.SaveChangesAsync();
}

Answers (3)