public static bool Validate(byte[] workflow) { try { byte[] copy = new byte[workflow.Length]; workflow.CopyTo(copy, 0); string json = string.Join("", WorkFlowUtils.BinaryToStrings(copy, 1024)); Structure structure = JsonConvert.DeserializeObject <Structure>(json); return(structure != null); } catch (JsonReaderException) { //TODO need to write some code here to log return(false); } }
private string GetBlob() { byte[] data = new byte[] { }; string sql = WorkFlowConfiguration.Binder.Setting.Parameter.Query; string strconn = WorkFlowConfiguration.Binder.Setting.Parameter.ConnectionString; using (OracleConnection conn = new OracleConnection(strconn)) { conn.Open(); using (OracleCommand cmd = new OracleCommand(sql, conn)) { using (IDataReader dataReader = cmd.ExecuteReader()) { while (dataReader.Read()) { data = (Byte[])dataReader[0]; } } } } return(string.Join("", WorkFlowUtils.BinaryToStrings(data, 1024))); }