public IAsyncResult BeginGetDivisionCodes(string environment , AsyncCallback callback, object state) { var connectionController = new ConnectionController(environment ); var controller = new ResponseController(connectionController.ConnectionString); var sproc = new DivisionCodeSelectStoredProcedure(); var task = Task<EntitySetResponse<DivisionCode>>.Factory.StartNew(r => controller.ExecuteEntitySet<DivisionCodeSelectStoredProcedure, DivisionCode>(sproc), state); return task.ContinueWith(r => callback(task)); }
public IAsyncResult BeginGetCatalogBrochures(string environment , string catalogYear, string catalogId, AsyncCallback callback, object state) { var connectionController = new ConnectionController(environment ); var controller = new ResponseController(connectionController.ConnectionString); var sproc = new CatalogBrochureSelectStoredProcedure(); sproc.SprocParameters["@Year"] = string.IsNullOrEmpty(catalogYear) ? null : catalogYear; sproc.SprocParameters["@CatalogId"] = string.IsNullOrEmpty(catalogId) ? (object)null : Convert.ToInt32(catalogId); var task = Task<EntitySetResponse<CatalogBrochure>>.Factory.StartNew(r => controller.ExecuteEntitySet<CatalogBrochureSelectStoredProcedure, CatalogBrochure>(sproc), state); return task.ContinueWith(r => callback(task)); }