IT tutorials
 
Technology
 

LINQ to SharePoint and SPMetal : Demonstration Scenario (part 1)

11/24/2013 6:09:06 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

Hopefully, you now have a clear understanding of what LINQ is and how it works. We need to use entity objects that represent the data in our application if we want to use LINQ syntax. To illustrate the use of LINQ to SharePoint and the tools for generating entity classes, consider the following scenario:

Your company is involved in renting industrial machinery. You’re working on a web-based application that allows customers to view a list of the items that the company currently rents, together with details of the individual rental contracts. Customers come from a number of geographical locations and sometimes relocate equipment from one location to another. To make it easier for customers to track the location of the rented equipment, your application allows the customer to add multiple notes for each item, and these notes should also be visible in your web application.

Note

You might appreciate a bit of clarification regarding some of the terminology used here. You non-British readers rent equipment, and equipment is said to be rented from the company. In the United Kingdom, we hire equipment, and equipment is said to be on hire when it is rented. So an “on-hire asset” refers to an asset that can be rented and is subject to a rental contract (or hire contract).


Since your company has a relatively small number of large customers, you’ve opted for an extranet solution. Each customer has a private site within your SharePoint farm that they can use to assist with managing their account with your company. Since Hire Contracts are standard documents used by all customers, you’ve defined a Hire Contract content type in your farm. Each customer site has a Contracts document library that contains Hire Contract documents. Additionally, you’ve defined an On-Hire Asset content type that represents the individual item of machinery that is subject to the rental contract. Each asset has a unique asset tag, and you allow customers to add notes against each asset tag in a separate list called Asset Notes. If implemented using a relational database, your data structure would look similar to Figure 1.

Figure 1. Logical data structure for extranet application


A common misconception is to equate a list or document library in SharePoint with a logical entity in your data structure. However, this isn’t necessarily the best approach and often making such an assumption makes you miss out on a lot of the real power of the SharePoint platform. A more useful parallel is to equate a logical entity with a content type. Since lists and document libraries can contain items of more than one content type, and sites can contain more than one list with the same content type, using lists and documents libraries to store items is mainly useful for setting security on a subset of items or for grouping items based on their status or some other business-specific reason. Bearing this in mind, when we translate our data structure into a SharePoint model, we end up with something similar to Figure 2. Logically, we still end up with the same collections of entities, but our use of content types allows us to create an unlimited number of web sites, each with the same structure and permissions to view only the customer-specific subset of data.

Figure 2. SharePoint implementation of logical data structure

If you compare this model to a standard ASP.NET application using a relational database to implement our original logical data structure, you can see that implementing security and filtering for each customer would incur significant overhead.

 
Others
 
- LINQ to SharePoint and SPMetal : LINQ to SharePoint
- LINQ to SharePoint and SPMetal : Overview of LINQ
- Microsoft Lync Server 2010 : Virtualization Overview (part 3) - Lync Support Guidelines
- Microsoft Lync Server 2010 : Virtualization Overview (part 2) - Benefits of Virtualization, Virtualization Vendors
- Microsoft Lync Server 2010 : Virtualization Overview (part 1) - Hypervisor Types
- Microsoft Lync Server 2010 : UC Endpoints (part 2) - USB Headsets, Speakerphones, and Handsets
- Microsoft Lync Server 2010 : UC Endpoints (part 1) - Standalone IP Phones
- Windows Small Business Server 2011 : Remote Web Access (part 5) - RWA Links List
- Windows Small Business Server 2011 : Remote Web Access (part 4) - Enabling or Disabling a User for RWA
- Windows Small Business Server 2011 : Remote Web Access (part 3) - Configuring the RWA Computer List - Enabling RWA Access to a Terminal Server
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us