In MicroLite 5.0, the mutability of the
SqlQuery object has been reduced. This change whilst helping improve the performance of MicroLite and reduce the memory footprint of the framework, does mean that the following methods on
IListener can no longer be supported:
void BeforeDelete(object instance, SqlQuery sqlQuery); void BeforeInsert(object instance, SqlQuery sqlQuery); void BeforeUpdate(object instance, SqlQuery sqlQuery);
They were originally added in MicroLite 1.2.0 as an extensible point in the pipeline but the purpose of them was never that clear and they were never actually used within the framework itself.
Will this affect you at all? probably not.
- If you have created a custom listener by inheriting from
MicroLite.Listeners.Listenerand have not overridden any of the methods mentioned then you won’t have a problem.
- If you instead implemented
MicroLite.Listeners.IListeneryourself then if you didn’t actually perform any work in the methods mentioned then you can just delete them and you won’t have a problem.
If you think this change might affect you, move your code into the
Before(object instance) method. If you were mutating the
SqlQuery, let us know what you were doing and we will let you know the best way to handle it in 5.0.