i tried this method that I created but it prompts me an error:
Realms.RealmInvalidObjectException:This object is detached. Was it deleted from the realm?\'
I already made it having this code :) thanks to @EpicPandaForce 's answer.
public void deleteFromDatabase(int denom_ID, int form_ID)
{
//Realm realm;
//and
//RealmConfiguration config = new RealmConfiguration(dbPath, true);
//was initialized at the top of my class
realm = Realm.GetInstance(config);
realm.Write(() =>
{
var cashflow_denom = realm.All().Where(c => c.denom_id == denom_ID);
var cashflow_form = realm.All().Where(c => c.form_id == form_ID);
realm.RemoveRange(((RealmResults)cashflow_denom));
realm.RemoveRange(((RealmResults)cashflow_form));
});
}
it is now deleting my data without exception :)