public void AddRoomType() { try { var roomType = new RoomType(); Console.WriteLine("Print Status: "); roomType.Type = Console.ReadLine(); if (!Validation.IsNullOrEmpty(roomType.Type) || !Validation.ValidateString(roomType.Type)) { AddRoomType(); } roomTypeService.AddRoomType(roomType); Console.WriteLine("Object successful added"); ConsoleRoomTypePresenter.Present(roomTypeService.ReadRoomTypes()); } catch (Exception ex) { Console.WriteLine(ex.Message); AddRoomType(); } }
public IEnumerable <RoomTypeViewModel> ReadRoomTypes() { return(mapper.Map <IEnumerable <RoomTypeViewModel> >(roomTypeRepository.ReadRoomTypes())); }