Remondo

.NET developers brain repository in plain C#

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • Tutorials
  • Code Snippets
  • Developer Podcasts
  • Presentations
  • Tools
  • Patterns and Principles

Tag Archives: linq

Post navigation

← Older posts

LINQ to SQL DataContext Identity Mapping

Posted on April 11, 2012 by Leon van Bokhorst

Each LINQ to SQL datacontext we instantiate holds its own identity map (based on Martin Fowlers Identity Map Pattern). This is basically a dictionary with identity keys pointing to entities in memory previously retrieved from the database – within the scope of the datacontext, that is. More…

Posted in Tutorial | Tagged linq, sql | Leave a reply

LINQ to SQL Insert Associations Example

Posted on April 10, 2012 by Leon van Bokhorst

Adding associated / related entities with LINQ to SQL is a breeze. In the snippet below we add a new TaskList with a new Task (‘Refactor’) for a specific Employee. LINQ to SQL keeps track of the associations and adds them as expected. More…

Posted in Snippet | Tagged linq, sql | Leave a reply

LINQ to SQL Insert, Update and Delete Example

Posted on April 9, 2012 by Leon van Bokhorst

Quick snippet below as a reminder of the most basic CUD operations in LINQ to SQL. We insert new entities with InsertOnSubmit on the specific entity collection in the datacontext. We delete existing entities the same way with the use of DeleteOnSubmit. More…

Posted in Snippet | Tagged linq, sql | Leave a reply

LINQ to XML Namespace Example

Posted on April 8, 2012 by Leon van Bokhorst

We use a XML namespace to avoid name conflicts. With a namespace we can more specifically point to an element in a XML structure. In LINQ to XML a namespace is represented by the XNamespace class. In the code snippet below we simply add a fictive namespace to the list of cars we created in the previous example. More…

Posted in Snippet | Tagged linq, namespace, xml | Leave a reply

Simple LINQ to XML Create and Parse Example

Posted on April 7, 2012 by Leon van Bokhorst

In the System.Xml.Linq namespace we find a lot of handy classes for creating and manipulating XML structures and files. XDocument respresents a complete XML structure with nodes (XNode) being elements (XElement) having attributes (XAttribute). More…

Posted in Snippet | Tagged linq, xml | Leave a reply

LINQ to SQL Executing SQL or Stored Procedures

Posted on April 4, 2012 by Leon van Bokhorst

It’s sometimes not possible to use LINQ to query to a database or for some reason we want to execute a SQL query statement from within our code. That’s possible by using the DataContext ExecuteQuery or ExecuteCommand methods. More…

Posted in Tutorial | Tagged linq, sql | Leave a reply

LINQ to SQL Single Table Inheritance Example

Posted on April 2, 2012 by Leon van Bokhorst

With LINQ to SQL we can get model inheritance with filtered mapping, called Single Table Inheritance. We do this by applying a discriminator value to the derived classes. By mapping this value LINQ to SQL knows to instantiate the appropriate base or derived class. More…

Posted in Tutorial | Tagged inheritance, linq, sql | Leave a reply

LINQ to SQL Lazy Loading Example with DataLoadOptions

Posted on April 1, 2012 by Leon van Bokhorst

By default LINQ to SQL is lazy. It defers loading of data until the very first moment it is needed by your application. This behavior makes it possible to keep adding peaces to our query until we are ready to fire a SQL statement to the database. More…

Posted in Tutorial | Tagged linq, sql | Leave a reply

Post navigation

← Older posts
Subscribe

ajax asp.net async bdd cache certificate code first concurrency csharp database entity framework exception handling factory gof http iis javascript jquery json linq mapping msmq mvc ood open source pattern reliability rest rss scrum security soap solid source control sql ssl tdd threading tracing unit testing visual studio was wcf windows xml

Archives

  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011

Comments

  • Leon van Bokhorst on The Strategy Pattern Example in C#Thanks
  • Hede on The Strategy Pattern Example in C#Nice hede article
  • Leon van Bokhorst on Simple Factory Pattern Example in C#Indeed; The Factory and Service Locator patterns perform functions found in Dependy Injection frameworks. They both adhere to the Dependency Inversion principle. That being...
  • Marco Vervoort on Simple Factory Pattern Example in C#Is dit niet de voorloper van Dependancy Injection? Met DI frameworks kun je dit ook uitvoeren, met meer configuratie mogelijkheden.
  • Leon van Bokhorst on Null Object Design Pattern Example in C#Thanks Alex
  • Alex on Null Object Design Pattern Example in C#Very well done. Hit and run example!
  • Leon van Bokhorst on Using Entity Framework DbSet LocalAha! Don't you just love it when that happens ;-)
  • Marco Vervoort on Using Entity Framework DbSet LocalWeer een 'ahaaa' moment... Leuke post.
  • Leon van Bokhorst on Hosting a WCF Service in IISGreat! :-D
  • Rafael on Hosting a WCF Service in IISI got it to work, thanks! My bad.
  • Rafael on Hosting a WCF Service in IISThanks again for the reply, so how did you publish to IIS? Using a WCF Web Service, like the post on this article?
  • Leon van Bokhorst on Hosting a WCF Service in IISI can't reproduce your problem. What I did was the following: - created a service library - connectionstring in the app.config - published the...
Leon van Bokhorst
(c) 2012 Remondo