{"id":2000,"date":"2015-10-27T20:51:14","date_gmt":"2015-10-27T20:51:14","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2000"},"modified":"2025-06-13T23:54:01","modified_gmt":"2025-06-14T06:54:01","slug":"linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/","title":{"rendered":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!"},"content":{"rendered":"<p>Today Couchbase is happy to announce the GA release of the official LINQ provider for Couchbase Server and the hot query language for JSON documents, N1QL! The goal of the provider is to provide a simple, easy to use ORM\/ODM that is closer to Linq2SQL than EntityFramework or NHibernate, which are verbose and can be complex.<\/p>\n<p>While simplicity is the goal, don&#8217;t underestimate the power of Linq2Couchbase; it&#8217;s a fully functional Linq implementation with extended support for all of N1QL&#8217;s awesome features!<\/p>\n<p>In this post we will go over the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana. In later posts we will go into more detail about specifics and details of Linq2Couchbase!<\/p>\n<h2 id=\"the-architecture\">The Architecture<\/h2>\n<p>The provider is really just another layer over the SDK; the provider handles query parsing and query generation and the SDK handles the request and mapping of the results. The provider uses <a href=\"https:\/\/relinq.codeplex.com\/\">Re-linq<\/a> internally to create an abstract syntax tree (AST) from the Linq query, which is then used to emit the N1QL statement. Note that Re-linq is used by both NHibernate and the EntityFramework, so your in good hands!<\/p>\n<h2 id=\"getting-started\">Getting Started<\/h2>\n<p>The source is available on <a href=\"https:\/\/github.com\/couchbaselabs\/Linq2Couchbase\">Github<\/a> and the package is available on <a href=\"https:\/\/www.nuget.org\/packages\/Linq2Couchbase\/1.0.2\">NuGet<\/a>; if you use NuGet package manager to install Linq2Couchbase all dependencies, including the Couchbase.NET SDK will be handled for you.<\/p>\n<p>To install Linq2Couchbase using the NuGet package manager (assuming you have already created a Visual Studio project) open the package manager by right clicking the &#8220;Manage Nuget Packages&#8221; and searching for Linq2Couchbase or using the package manager command line:<\/p>\n<pre><code>PM&gt; Install-Package Linq2Couchbase \r\n<\/code><\/pre>\n<p>Once you have done this the project will have all the necessary dependencies. Next you&#8217;ll need to install Couchbase Server either locally or via VM&#8217;s. The download link for Couchbase Server is <a href=\"https:\/\/www.couchbase.com\/nosql-databases\/downloads\/\">here<\/a>. For the VM&#8217;s, use <a href=\"https:\/\/github.com\/couchbaselabs\/vagrants\">vagrants<\/a> which uses Puppet and Vagrant to install a cluster of Couchbase servers. Make sure you install Couchbase 4.0! If you are using Vagrants, then provision up the cluster:<\/p>\n<pre><code>peep@ELJEFE-PC ~\/repos\/vagrants\/4.0.0\/debian7 (master)\r\n$ vagrant up\r\n<\/code><\/pre>\n<p>Once you have a Couchbase Server or cluster, setup up the Server or Cluster and <strong><em>make sure at least one node is an Index node and one node is a Query node<\/em><\/strong>. You will do this on the the first step of the &#8220;Server Setup&#8221; or when you add an additional server to your cluster. Also, add the &#8220;beer-sample&#8221; data set to the cluster during setup or from the Settings&gt;Samples tab after you have setup up the cluster or instance.<\/p>\n<p>Now that your Couchbase instance or cluster is setup, you will need to create a primary index in the &#8220;beer-sample&#8221; bucket. To do this either navigate <code>C:Program FilesCouchbaseServerbin or if using vagrants<\/code> (or linux) <code>\/opts\/couchbase\/bin<\/code>using a command prompt. Then type either cbq or .\/cbq (on linux) to start the query CIL and then:<\/p>\n<pre><code>CREATE PRIMARY INDEX ON `beer-sample` USING GSI;\r\n<\/code><\/pre>\n<p>This will create a primary index on the beer-sample bucket. Note the backticks &#8220;`&#8221;, these are required to escape the &#8220;-&#8221; in beer-sample. Now you are ready to write some code!<\/p>\n<h2 id=\"creating-the-bucketcontext\">Creating the BucketContext<\/h2>\n<p>The main object for working with the bucket is the BucketContext. The BucketContext is analogous to the DataContext in Linq2Sql and the DbContext in the EntityFramework. It&#8217;s primary purpose is to provide and interface for building queries and submitting them to the Couchbase server.<\/p>\n<p>You can use the BucketContext as a stand-alone object or you can derive from it and create a strongly typed object that maps properties to the types in your bucket and domain model. In this example I will do the latter:<\/p>\n<pre><code>\/\/\/ \r\n\r\n\/\/\/ A concrete DbContext for the beer-sample example bucket.\r\n\/\/\/ <\/code><\/pre>\n<p>public class BeerSample : BucketContext { public BeerSample() : this(ClusterHelper.GetBucket(&#8220;beer-sample&#8221;)) { } public BeerSample(IBucket bucket) : base(bucket) { DocumentFilterManager.SetFilter(new BreweryFilter()); } public IQueryable Beers { get { return Query(); } } public IQueryable Breweries { get { return Query(); } } }<\/p>\n<p>The beer-sample bucket (a bucket is similar to a database in a RDBMS system) contains documents that are &#8220;typed&#8221; as a &#8220;brewery&#8221; and a &#8220;beer&#8221;, this informal type system will allow to query the bucket and return either brewery documents or beer documents via a predicate(WHERE type=&#8221;beer&#8221; for example). In the code above we have defined explicit properties which return IQueryable<\/p>\n<h2 id=\"an-example-query\">An Example Query<\/h2>\n<p>You will find that using Linq2Couchbase is pretty much identical to Linq2SQL or the EF:<\/p>\n<pre><code>var db = new BeerSample();\r\n\r\nvar query = from beer in db.Beers\r\n            join brewery in db.Breweries\r\n            on beer.BreweryId equals N1QlFunctions.Key(brewery)\r\n            select new { beer.Name, beer.Abv, BreweryName = brewery.Name };\r\n\r\nforeach (var beer in query)\r\n{\r\n    Console.WriteLine(beer.Name);\r\n}    \r\n<\/code><\/pre>\n<p>Once you have a BucketContext reference all you do is query it like you would any other Linq provider. All Linq keywords are supported as well as N1QL constructs like ON KEYS, NEST and UNNEST! In a later post, we will go over all of this is much greater detail!<\/p>\n<h2 id=\"the-document-model\">The Document Model<\/h2>\n<p>In the BeerSample context above, the Beer and Brewery objects will be the targets for our Linq projections and they correspond or map to equivalent JSON documents in our bucket (beer-sample). Here is a listing for each (note that this is partial listing, the classes in their entirety can be found <a href=\"https:\/\/github.com\/couchbaselabs\/Linq2Couchbase\/tree\/master\/Src\/Couchbase.Linq.IntegrationTests\/Documents\">here<\/a>):<\/p>\n<pre><code>[Filters.DocumentTypeFilter(\"beer\")]\r\npublic class BeerFiltered\r\n{\r\n    [JsonProperty(\"name\")]\r\n    public string Name { get; set; }\r\n\r\n    [JsonProperty(\"abv\")]\r\n    public decimal Abv { get; set; }\r\n\r\n    ...\r\n\r\n    [JsonProperty(\"category\")]\r\n    public string Category { get; set; }\r\n\r\n    [JsonProperty(\"updated\")]\r\n    public DateTime Updated { get; set; }\r\n}\r\n<\/code><\/pre>\n<p>This of course maps to &#8220;beer&#8221; documents; note that DocumentTypeFilter attribute. This will &#8220;auto-magically&#8221; add a predicate or WHERE clause that filters by the type &#8220;beer&#8221; to every query that targets that document. The DocumentTypeFilter attribute is one of two ways to apply a filter, unless you manually add the predicate to each query.<\/p>\n<pre><code>public class Brewery\r\n{\r\n    [JsonProperty(\"name\")]\r\n    public string Name { get; set; }\r\n\r\n    [JsonProperty(\"city\")]\r\n    public string City { get; set; }\r\n\r\n    ...\r\n\r\n    [JsonProperty(\"geo\")]\r\n    public Geo Geo { get; set; }\r\n\r\n    [JsonProperty(\"beers\")]\r\n    public List Beers { get; set; }\r\n}\r\n<\/code><\/pre>\n<p>This is the object that &#8220;brewery&#8221; documents will be mapped to. Note that there is no DocumentTypeFilter attribute explicitly defined; that is because the constructor for the BeerSample context will add the filter to the DocumentFilterManager. This is purely a different approach to the same problem; adding a predicate to a query to filter by type.<\/p>\n<h2 id=\"integrating-with-asp-net-or-owin-katana\">Integrating with ASP.NET or Owin\/Katana<\/h2>\n<p>Their is a very distinct pattern for using the Couchbase .NET SDK in ASP.NET or Katana\/OWin projects. Since the BucketContext uses the Couchbase .NET SDK, you will need to follow this pattern so that you have take advantage object caching within the SDK and shared TCP connections. Fortunately, its a very simple pattern:<\/p>\n<h3 id=\"using-global-asax-in-asp-net\">Using Global.asax in ASP.NET<\/h3>\n<p>In an ASP.NET application using Global.asax, you will take advantage of the Application_Start and Application_End event handlers to create and destroy the Cluster and Bucket objects that the BucketContext depends on.<\/p>\n<pre><code>public class MvcApplication : System.Web.HttpApplication\r\n{\r\n    protected async void Application_Start()\r\n    {\r\n        AreaRegistration.RegisterAllAreas();\r\n        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);\r\n        RouteConfig.RegisterRoutes(RouteTable.Routes);\r\n        BundleConfig.RegisterBundles(BundleTable.Bundles);\r\n\r\n        var config = new ClientConfiguration\r\n        {\r\n            Servers = new List\r\n            {\r\n                new Uri(\"https:\/\/192.168.77.101:8091\/\")\r\n            }\r\n        };\r\n\r\n        ClusterHelper.Initialize(config);\r\n        var bucket = ClusterHelper.GetBucket(\"default\");\r\n    }\r\n\r\n    protected void Application_End()\r\n    {\r\n        ClusterHelper.Close();\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Here we are creating the configuration (btw this could come from the App.Config as well) and then initializing the ClusterHelper object. Finally when the application shuts down, we are destroying the long-lived Cluster and Bucket objects in the Application_End handler. This will be a graceful shutdown and OS level constructs will be returned back to the OS in a timely manner.<\/p>\n<h3 id=\"using-setup-cs-in-owin-katana\">Using Setup.cs in Owin\/Katana<\/h3>\n<p>In Owin\/Katana hosted applications, we follow a similar pattern, we just use a different method, the Setup.cs class.<\/p>\n<pre><code>public partial class Startup\r\n{\r\n    public void Configuration(IAppBuilder app)\r\n    {\r\n        ConfigureAuth(app);\r\n\r\n        \/\/initialize the ClusterHelper\r\n        ClusterHelper.Initialize(new ClientConfiguration\r\n        {\r\n            Servers = new List\r\n            {\r\n                new Uri(\"https:\/\/localhost:8091\/\")\r\n            }\r\n        });\r\n\r\n        \/\/Register a callback that will dispose of the ClusterHelper on app shutdown\r\n        var properties = new AppProperties(app.Properties);\r\n        var token = properties.OnAppDisposing;\r\n        if (token != CancellationToken.None)\r\n        {\r\n            token.Register(() =&gt;\r\n            {\r\n                ClusterHelper.Close();\r\n            });\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Here we create and initialize the ClusterHelper when the Configuration method runs at startup and then we register a delegate that will fire when the application shuts down, closing our ClusterHelper and freeing up resources.<\/p>\n<h3 id=\"injecting-into-your-controllers\">Injecting into your Controllers<\/h3>\n<p>The BucketContext itself takes on the characteristics of the Unit of Work pattern; you can create one for each request and since the ClusterHelper manages the references (assuming you are following the advice above) the instance will simply be GC&#8217;d at the end of the request.<\/p>\n<p>The simplest way to do this is by simply using <a href=\"https:\/\/www.couchbase.com\/blog\/dependency-injection-aspnet-couchbase\/\">Dependency Injection<\/a> (the pattern) within your Controllers to create the instance when the controller is created, for example:<\/p>\n<pre><code>public class HomeController : Controller\r\n{\r\n    private BeerSample _context;\r\n\r\n    public HomeController()\r\n        : this(new BeerSample(ClusterHelper.GetBucket(\"beer-sample\")))\r\n    {\r\n    }\r\n\r\n    public HomeController(BeerSample context)\r\n    {\r\n        _context = context;\r\n    }\r\n\r\n    ...\r\n}\r\n<\/code><\/pre>\n<p>Now, you simply use the BucketContext within your Action methods:<\/p>\n<pre><code>public ActionResult Index()\r\n{\r\n    var query = (from beer in db.Beers\r\n        join brewery in db.Breweries\r\n        on beer.BreweryId equals N1QlFunctions.Key(brewery)\r\n        select new { \r\n            beer.Name, \r\n            beer.Abv, \r\n            BreweryName = brewery.Name \r\n        }).Take(10);\r\n\r\n    return View(query.ToList());\r\n}\r\n<\/code><\/pre>\n<p>Once again, since the context a short-lived lightweight object, you could scope it to the request and inject it there reusing it for all controllers invoked within that request.<\/p>\n<h2 id=\"what-s-coming-up-\">What&#8217;s coming up?<\/h2>\n<p>Very quickly, the next major feature will be Change Tracking using proxies. Additionally, expect bug fixes, performance enhancements and other featured aimed at making Linq2Couchbase a fully featured, lightweight ODM\/ORM!<\/p>\n<p>If there is a feature you want, a bug fix or perhaps you want to contribute we welcome all kinds of feedback both good and bad.<\/p>\n<ul>\n<li>The Jira is <a href=\"https:\/\/issues.couchbase.com\/projects\/LINQ\">here<\/a>.<\/li>\n<li>The Githb project is <a href=\"https:\/\/github.com\/couchbaselabs\/Linq2Couchbase\/\">here<\/a>.<\/li>\n<\/ul>\n<p>Linq2Couchbase is an community-driven, open source project, so please take a look at it and if you would like to contribute, please do!<\/p>\n<h2 id=\"special-thanks\">Special Thanks<\/h2>\n<p>A special thanks to all of those who contributed to the project (it is Open Source after all!), especially to <a href=\"https:\/\/github.com\/brantburnett\">Brant Burnett<\/a> of <a href=\"https:\/\/centeredgesoftware.com\/\">Centeredge Software<\/a> who contributed significantly to the project and documentation on NuGet!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today Couchbase is happy to announce the GA release of the official LINQ provider for Couchbase Server and the hot query language for JSON documents, N1QL! The goal of the provider is to provide a simple, easy to use ORM\/ODM [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1811,1812],"tags":[1468,1469],"ppma_author":[8970],"class_list":["post-2000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-n1ql-query","tag-linq","tag-linq2couchbase"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase<\/title>\n<meta name=\"description\" content=\"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!\" \/>\n<meta property=\"og:description\" content=\"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-27T20:51:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T06:54:01+00:00\" \/>\n<meta name=\"author\" content=\"Jeff Morris, Senior Software Engineer, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jeffrysmorris\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Morris, Senior Software Engineer, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\"},\"author\":{\"name\":\"Jeff Morris, Senior Software Engineer, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b678bdd9f7b21a33d43ea965865a3341\"},\"headline\":\"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!\",\"datePublished\":\"2015-10-27T20:51:14+00:00\",\"dateModified\":\"2025-06-14T06:54:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\"},\"wordCount\":1422,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Linq\",\"linq2couchbase\"],\"articleSection\":[\".NET\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\",\"name\":\"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2015-10-27T20:51:14+00:00\",\"dateModified\":\"2025-06-14T06:54:01+00:00\",\"description\":\"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b678bdd9f7b21a33d43ea965865a3341\",\"name\":\"Jeff Morris, Senior Software Engineer, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/73188ee2831025d81740e12e1ed80812\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5f910befdbd58de8bac85293df7f544680843061ecc921ba7d293d6d52076ab3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5f910befdbd58de8bac85293df7f544680843061ecc921ba7d293d6d52076ab3?s=96&d=mm&r=g\",\"caption\":\"Jeff Morris, Senior Software Engineer, Couchbase\"},\"description\":\"Jeff Morris is a Senior Software Engineer at Couchbase. Prior to joining Couchbase, Jeff spent six years at Source Interlink as an Enterprise Web Architect. Jeff is responsible for the development of Couchbase SDKs and how to integrate with N1QL (query language).\",\"sameAs\":[\"https:\/\/x.com\/jeffrysmorris\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/jeff-morris\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase","description":"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/","og_locale":"en_US","og_type":"article","og_title":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!","og_description":"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.","og_url":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/","og_site_name":"The Couchbase Blog","article_published_time":"2015-10-27T20:51:14+00:00","article_modified_time":"2025-06-14T06:54:01+00:00","author":"Jeff Morris, Senior Software Engineer, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@jeffrysmorris","twitter_misc":{"Written by":"Jeff Morris, Senior Software Engineer, Couchbase","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/"},"author":{"name":"Jeff Morris, Senior Software Engineer, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b678bdd9f7b21a33d43ea965865a3341"},"headline":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!","datePublished":"2015-10-27T20:51:14+00:00","dateModified":"2025-06-14T06:54:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/"},"wordCount":1422,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Linq","linq2couchbase"],"articleSection":[".NET","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/","url":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/","name":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2015-10-27T20:51:14+00:00","dateModified":"2025-06-14T06:54:01+00:00","description":"Learn the basics of getting started with Linq2Couchbase, the major actors in the API, and integration with ASP.NET and Owin\/Katana.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/linq-n1ql-and-couchbase-oh-mai-linq2couchbase-ga\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Couchbase LINQ Provider GA: LINQ, N1QL and Couchbase, oh mai!"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/b678bdd9f7b21a33d43ea965865a3341","name":"Jeff Morris, Senior Software Engineer, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/73188ee2831025d81740e12e1ed80812","url":"https:\/\/secure.gravatar.com\/avatar\/5f910befdbd58de8bac85293df7f544680843061ecc921ba7d293d6d52076ab3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5f910befdbd58de8bac85293df7f544680843061ecc921ba7d293d6d52076ab3?s=96&d=mm&r=g","caption":"Jeff Morris, Senior Software Engineer, Couchbase"},"description":"Jeff Morris is a Senior Software Engineer at Couchbase. Prior to joining Couchbase, Jeff spent six years at Source Interlink as an Enterprise Web Architect. Jeff is responsible for the development of Couchbase SDKs and how to integrate with N1QL (query language).","sameAs":["https:\/\/x.com\/jeffrysmorris"],"url":"https:\/\/www.couchbase.com\/blog\/author\/jeff-morris\/"}]}},"authors":[{"term_id":8970,"user_id":21,"is_guest":0,"slug":"jeff-morris","display_name":"Jeff Morris, Senior Software Engineer, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/5f910befdbd58de8bac85293df7f544680843061ecc921ba7d293d6d52076ab3?s=96&d=mm&r=g","author_category":"","last_name":"Jeff Morris, Senior Software Engineer, Couchbase","first_name":"Jeff","job_title":"","user_url":"","description":"Jeff Morris is a Senior Software Engineer at Couchbase. Prior to joining Couchbase, Jeff spent six years at Source Interlink as an Enterprise Web Architect. Jeff is responsible for the development of Couchbase SDKs and how to integrate with N1QL (query language)."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2000"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2000\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2000"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}