Skip to main content

Posts Tagged ‘LINQ’

Getting to Know PredefinedQuery with Sitecore Content Search

Recently I’ve been working a lot with the Sitecore Content Search API and found myself writing a lot of code like this: var allTheThings = context.GetQueryable<Thing>().Where(x => x.TemplateId == Constants.Thing.TemplateId && x.IsSearchable); As we’re always looking for better ways to do things around here and my laziness started to prevail, I thought, “there has got […]

LINQ Querying of InfoPath 2010 Forms

Recently, I was asked to create an InfoPath 2010 form that would distribute user input into three different lists on a SharePoint 2010 site. To avoid using code within the InfoPath form itself and to make it easier to deploy into SharePoint, I created an event receiver on the forms library where the InfoPath form […]

Querying an SPFieldMultiLineText field for an exact line match with LINQ

Today, I had to come up with a way to return a value from one column in a SharePoint list based on finding an exact line match of a user’s query terms in an SPFieldMultiLineText field in the same list. To clarify, here’s an example of how the data looked like in the SharePoint list […]

Using LINQ to Order SharePoint List Items and Choice Site Columns within a Dropdown List

Populating dropdown lists data from choice site columns and lookup lists is a fairly common task when creating custom SharePoint web parts.A small side effect of doing this is that when the dropdown is populated, the values will often not be in alphabetical order. This is not the end of the world, so the simplest, […]

LINQ to SharePoint with SharePoint 2010

With SharePoint 2010, LINQ to SharePoint is now fully supported. It now offers the ability to work with strongly typed objects as well as the ability to use the LINQ syntax which is easier than using CAML. Another great advantage of using LINQ to SharePoint is that you can join SharePoint lists which can be […]