Telerik blogs

Latest

  • Productivity

    How Does the First Level Cache of Telerik OpenAccess ORM Work

    Telerik OpenAccess ORM has two levels of caching. The upper one is a local cache specific for each IObjectScope instance and it is the focus of this post. The lower cache, the second level cache is common for all IObjectScope objects and is used to hold unchanged database content in memory. The values for various fields of the user objects (like a Person instance) are duplicated in the L2 cache. It is populated during read access and gives fast retrieval of commonly used objects. Additionally, the cache can contain complete query results. Note that the L2 cache is not enabled by...
    May 27, 2021 3 min read
  • Productivity

    Retrieving object from the database using only its key

    When you try to persist an object Telerik OpenAccess ORM will require an “identity” so that the object is uniquely identified for storage and retrieval. Usually this id is mapped directly to a primary key column or columns (composite key) in the database and identifies also the in-memory representation of the object. Using this identifier, you can directly retrieve the object from the database. Supposing that we have table with an int primary key (for example the Category table from the Northwind database) and we want to retrieve the Category with id that is equal to 6 directly. We would need...
    May 27, 2021 3 min read
  • Productivity

    LINQ To M Refresh

    If case you did not know, Telerik released LINQ to M a few weeks ago, enabling you to use a LINQ style interface with M values of data. Mehfuz and I have written blog posts where you can see how to use the basics.  There have been tremendous amounts of downloads and we have gotten tons of feedback. (Thanks, keep it coming!) One thing that stood out is that when you are building M values a lot of time you will have a named instance of your M code like this: 1: //People is the named "M" instance 2: People{ 3: {Id=1,Name="Stephen Forte",Age=37}, 4: {Id=2,Name="Mehfuz Hossain",Age=29}, 5: {Id=3,Name="Vassil Terziev",Age=31}, 6: {Id=4,Name="Nadia Terziev",Age=27}, 7: {Id=5,Name="Chris Sells",Age=37}, 8: {Id=6,Name="Todd Anglin",Age=27}, 9: {Id=7,Name="Joel Semeniuk",Age=37}, 10: {Id=8,Name="Richard...
    May 27, 2021 2 min read
  • Productivity

    LINQ Tip of the week: A quick peek behind the curtains

    In our previous post in this series we had a look at how to optimize query execution with the help of parameterized queries. Today we will briefly look at what actually happens ‘behind the curtains’ when a LINQ query is executed and you get back  the results.   As you already know LINQ can be used to query various data sources like in-memory objects, XML or databases,which is of particular interest to us. Consider the following example where we query for all employees who are born in the same month as today i.e.  in the month of July.   var employees = from e in scope.Extent<Employee>()                           where e.BirthDate.Month == DateTime.Now.Month                           select e;   As you can...
    May 27, 2021 2 min read
  • Productivity

    Using the DragDropService in RadDock

    Overview The new docking framework introduces service-based semantic, which allows for granular and pluggable functionality per RadDock. Entire drag-and-drop functionality is handled by the registered DragDropService instance, which simply receives drag requests and instantiates the appropriate operation. The service is responsible for drop target hit-testing, displaying docking guides and docking hints as well as for processing user input while dragging is in progress. On the screen above, toolWindow3 instance is being dragged. The service has hit-tested the MainDocumentContainer as a drop anchor and the appropriate docking guide is displayed. The “Left” docking position is selected and the service “hints” the user...
    May 27, 2021 4 min read