public IHttpActionResult Post([FromBody] List <dataTypeList.dataType> input) { IDbConnection db = HdbController.Connect(this.Request.Headers); var sdiProcessor = new HdbApi.DataAccessLayer.SiteDataTypeRepository(); List <string> sdi = new List <string>(); List <string> sid = new List <string>(); List <string> did = new List <string>(); foreach (dataTypeList.dataType dType in input) { //if (dType.sdi > 0) //{ sdi.Add(dType.sdi); } //if (dType.sid > 0) //{ sid.Add(dType.sid); } //if (dType.did > 0) //{ did.Add(dType.did); } sdi.Add(dType.sdi); sid.Add(dType.sid); did.Add(dType.did); } var result = sdiProcessor.GetSiteDataTypes(db, sdi.ToArray(), sid.ToArray(), did.ToArray()); try { db.Close(); db.Dispose(); } catch { } return(Ok(result)); }
public IHttpActionResult Get([FromUri] string[] sdi = null, [FromUri] string[] sid = null, [FromUri] string[] did = null) { IDbConnection db = HdbController.Connect(this.Request.Headers); var sdiProcessor = new HdbApi.DataAccessLayer.SiteDataTypeRepository(); var result = sdiProcessor.GetSiteDataTypes(db, sdi, sid, did); try { db.Close(); db.Dispose(); } catch { } return(Ok(result)); }