Telerik blogs

Latest

  • 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...
    August 04, 2009 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...
    July 31, 2009 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...
    July 30, 2009 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...
    July 30, 2009 4 min read
  • Productivity

    Using Interceptors with Ado.Net Data Services and Telerik OpenAccess ORM

    ADO.NET Data Services enables an application to intercept request messages so that you can add custom logic to an operation. You can use this custom logic to validate data that goes to the client or returns to be persisted on the server. You can also use it to modify and filter further the scope of a query request, or add in that way a custom authorization policy on a per request basis. Interception is performed by specially attributed methods in the data service. These methods are called by ADO.NET Data Services at the appropriate point in message processing. Interceptors cannot accept...
    July 28, 2009 2 min read