subsonic / SubSonic-3.0-Templates

T4 Template Project for the peeps
http://subsonic.github.io/
105 stars 46 forks source link

Destroy(Expression) method in ActiveRecord throws error #42

Open georgexcollins opened 14 years ago

georgexcollins commented 14 years ago

See stackoverflow: http://stackoverflow.com/questions/2141738/subsonic-3-activerecord-delete-destroy-throwing-strange-exception/2187630#2187630

If a table has logical delete isDeleted column, then the templates generate a static Destroy(Expression) method. However this calls the underlying SubSonicRepository Delete(Expression) which doesn't exist.

I think the solution is to change the template to call SubSonicRepository.DeleteMany(Expression) instead which does exist. Should the ActiveRecord static method also be renamed to "DestroyMany"?

georgexcollins commented 14 years ago

Pull request submitted with a fix.