public FiltrRoomHolidayHome CreateObject(Choose choose) { switch (choose.ToString()) { case "Room": return(new FiltrClassRoom(repository)); case "HolidayHome": return(new FiltrClassHolidayHome(repository)); default: throw new ArgumentException(); } }