// Finner en eller flere kundetyper for et firma //Get /api/CustomerToTypes/1 public IEnumerable <CustomerTypeDto> GetCustomerToTypes(int Id) { List <CustomerType> types = new List <CustomerType>(); var customerToType = _context.CustomerToTypes.Where(c => c.CustomerId == Id).ToList(); foreach (var type in customerToType) { types.Add(type.CustomerType); } return(DtoHelper.MapTypeListToDtoList(types)); }
// GET: api/CustomerTypes public IEnumerable <CustomerTypeDto> GetCustomerTypes() { return(DtoHelper.MapTypeListToDtoList(db.CustomerTypes.ToList())); }