JavaScriptSerializer js = new JavaScriptSerializer(); var itp = js.Deserialize<List<RetailItemsToPrint>>(formValues["itemsToPrint"].ToString()); if (itp == null) { labels.AlertType = "error"; labels.AlertMessage = Messages.noItemsToPrint; } else { // Here we may need different methods for different types of labels // This currently works for retail labels only RetailItemsToPrintCollection itemsToPrint = new RetailItemsToPrintCollection(); itemsToPrint.AddRange(itp); List<ReportData> gatherData = _reportsRepository.GatherRetailLabelsData(itemsToPrint); List<ReportDataSource> reportData = new List<ReportDataSource>(); if (gatherData != null) { foreach (ReportData rd in gatherData) { ReportDataSource rds = new ReportDataSource(rd.Name, rd.Data); reportData.Add(rds); } } labels.ReportData = reportData; }I'm trying to figure out how to change it to allow different types of labels. I added a new type RentalItemsToPrint, so when my labelType=="Rental" I need to have different type for itp, etc.