3
Answers

Converting List

Geni Lou

Geni Lou

3y
653
1
is this the best way to convert a repository to model?
  1. public static List<ProductRepository> ToRepositories(this List<ProductModel> model){  
  2. var repo = new List<ProductRepository>();  
  3. foreach (var m in model){  
  4. repo.Add(m.ToRepository());  
  5. }  
  6. return repo;  
  7. }  
Answers (3)