Tuesday, September 28, 2021

Change detection in EF

Entity Framework change tracking is often something that doesn't require too much thought from the app developer. However, change tracking and the DetectChanges method are a part of the stack where there is a tension between ease-of-use and performance. For this reason it can be useful to have an idea of what is actually going on such you can make an informed decision on what to do if the default behavior is not right for your app.

Part 1: What does DetectChanges do?
http://blog.oneunicorn.com/2012/03/10/secrets-of-detectchanges-part-1-what-does-detectchanges-do/

Part 2: When is DetectChanges called automatically?
http://blog.oneunicorn.com/2012/03/11/secrets-of-detectchanges-part-2-when-is-detectchanges-called-automatically/

Part 3: Switching off automatic DetectChanges
http://blog.oneunicorn.com/2012/03/12/secrets-of-detectchanges-part-3-switching-off-automatic-detectchanges/

Part 4: Binary properties and complex types
http://blog.oneunicorn.com/2012/03/13/secrets-of-detectchanges-part-4-binary-properties-and-complex-types/

Monday, September 20, 2021

Lambda and anonymous functions

The point here is that whether a function has a name or not is not particularly important compared to whether or not the function is used as data. JavaScript supports named and unnamed lambdas, and it's useful to understand that a named function can be anonymous. If you don't consider a named function to be a lambda, you're missing the point of lambdas. TL;DR - Lambda means "function expression used as data".