public IActionResult GetRoomTypes() { List <RoomType> roomTypes = iRoomTypeRepository.GetRoomTypes(); /*encoding(against xss) at the get request, so as to store the entity column in its plain form in the database*/ if (roomTypes != null) { roomTypes.ForEach(x => { if (x != null) { string encodedRoomTypeName = htmlEncoder.Encode(x.Name); x.Name = encodedRoomTypeName; } }); return(Ok(roomTypes)); } return(NotFound("No room types were found!")); }
public List <RoomType> GetRoomTypes() { return(_roomTypeRepository.GetRoomTypes().ToList()); }
public async Task <IEnumerable <RoomTypes> > GetRoomTypes() { return(await _roomTypeRepository.GetRoomTypes()); }