Reputation: 496
I've had problems with the update method in subsonic, so instead of using:
a.Update()
I used
var qry = dbAnimals.Update<Notification>().
Set(n => n.NotName == notification.NotName).
Set(n => n.NotRecStatus == notification.NotRecStatus).
Set(n => n.NotModified == notification.NotModified).
Where(n => n.NotRecID == id).Execute();
The thing is that I now want to delete, and I get the same nullreference exception. so
a.Delete()
does not work. What would be the equivalent to delete that row depending on its ID? I have tried to find it but didn't get a clue.
Thank you:
Upvotes: 0
Views: 1182
Reputation: 496
To solve this problem I finally used this:
var query = new SubSonic.Query.Delete<Notification>(dbAnimals.DataProvider).
From<Notification>().
Where(NotificationTable.NotRecIDColumn).IsEqualTo(id).
Execute();
Upvotes: 4