• .NET

    String Matching in LINQ

    Performing simple string equality tests is often not enough when application user convenience is key. Often only a fragment of a string is known to the user, or many of them. Sometimes there is a need to search for a fragment in multiple columns. Which options does OpenAccess and LINQ provide to perform string matching? Into which SQL is the LINQ expression translated? Let’s use a simple class model for this post: a Person with a FirstName, a LastName and a NickName. Let’s assume parameters with the name simpleParam (string) and manyParam (ICollection<string>). String equality comparison Using the standard Equals method translates directly into...
    April 17, 2012
  • .NET

    Why OpenAccess does require transactions?

    OpenAccess relies on lazy loading and change tracking to make is as easy as possible for the user to work with persistent data. But we need a point in time where we can collect all changes in memory and execute the insert, update and delete statements to persist the changes. Typically this is the job of a transaction. The easiest way is to never let OpenAccess run without a started transaction. In this case you only have to call commit or...