// GET: api/Article public IEnumerable <DTO.Product> Get() { IReadOnlyCollection <Product> products = _repository.Get(); List <DTO.Product> dtos = new List <DTO.Product>(); foreach (var product in products) { var dto = _assembler.ToDto(product); dtos.Add(dto); } return(dtos); }
public IEnumerable <DTO.Order> GetByCustomerID(int id) { List <DTO.Order> dtoList = new List <DTO.Order>(); var orders = _repository.GetByCustomerID(id); foreach (var order in orders) { var dto = _assembler.ToDto(order); dtoList.Add(dto); } return(dtoList); }