public ModelNotifiedForTerritories GetTerritoriesByID(string TerritoryID, out string error) { error = null; TerritoriesGenericREST TerritoriesGenericREST = new TerritoriesGenericREST(wpfConfig); GetTerritoriesView getTerritoriesView = TerritoriesGenericREST.GetByPK <GetTerritoriesView>(TerritoryID, out error)[0]; ModelNotifiedForTerritories modelNotifiedForTerritories = new ModelNotifiedForTerritories(); Cloner.CopyAllTo(typeof(GetTerritoriesView), getTerritoriesView, typeof(ModelNotifiedForTerritories), modelNotifiedForTerritories); return(modelNotifiedForTerritories); }