If the delete statement is executed, the record can't be returned
because the value for the rowid doesn't exist in the database
Therefore, in the case of delete, the record is returned to null
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
Co-authored-by: pjh9216 <jh9216.park@samsung.com>
{
Open(new Uri(openString));
}
{
Open(new Uri(openString));
}
public void Close()
{
if (_opened)
public void Close()
{
if (_opened)
Sql sql = new Sql(string.Format("SELECT * from {0} WHERE rowid = {1}", table_name, rowid));
using (IStatement stmt = CreateStatement())
{
Sql sql = new Sql(string.Format("SELECT * from {0} WHERE rowid = {1}", table_name, rowid));
using (IStatement stmt = CreateStatement())
{
- IRecord record = stmt.ExecuteQuery(sql).FirstOrDefault();
+ IRecord record = (operationType != OperationType.Delete ? stmt.ExecuteQuery(sql).FirstOrDefault() : null);
RecordChangedEventArgs ev = new RecordChangedEventArgs(operationType, db_name, table_name, record);
_recordChanged?.Invoke(this, ev);
}
RecordChangedEventArgs ev = new RecordChangedEventArgs(operationType, db_name, table_name, record);
_recordChanged?.Invoke(this, ev);
}