mikependon / RepoDB

A hybrid ORM library for .NET.
Apache License 2.0
1.7k stars 125 forks source link

Enhancement: Lazy Property Handler #1121

Open dylanvdmerwe opened 1 year ago

dylanvdmerwe commented 1 year ago

Describe the enhancement

From the docs around property handlers, you have this example: image image

What would be incredible is for RepoDB in the background to hold the backing string on the POCO on retrieval. Only when the property is first accessed, is the property handler run (i.e deserialized). In this way you defer the cost of the property handler for when it is first used, and thereafter the object is set.

mikependon commented 1 year ago

Hmmm, interesting proposal. Definitely, it will improve the perf specially if property handler is doing an extensive operation. We will look how this is possible with the existing implementation we had, most likely not due to PH dependency to the connection.