SlideShare a Scribd company logo
LinqToSharePoint
SandBoxed Solution



Shakir Majeed Khan
http://sharepointtechies.wordpress.com/
MySelf
http://junooni.wordpress.com/
shakir.majeed@gmail.com
www.facebook.com/shakir.majeed

      User Group Leader of
      SharePoint Techies,
      Working independently on
      SharePoint technologies.
      Trainer for Microsoft Office
      SharePoint Server
      2007 and Window
      SharePoint Services 3.0 at
      AUC Technologies.
Agenda
 session is divided into two
   LinqtoSharePoint
   SandBoxed Solution
 Questions
What’s wrong with this

                                                   Queries in
 SqlConnection c = new SqlConnection(…);            quotes
 c.Open();
 SqlCommand cmd = new SqlCommand(
   @"SELECT c.Name, c.Phone                      Loosely bound
      FROM Customers c                             arguments
      WHERE c.City = @p0");
 cmd.Parameters.AddWithValue("@p0", "London“);
 DataReader dr = c.Execute(cmd);                  Loosely typed
 while (dr.Read()) {                               result sets
    string name = dr.GetString(0);
    string phone = dr.GetString(1);
    DateTime date = dr.GetDateTime(2);           No compile time
 }                                                   checks
 dr.Close();
What’s wrong with this
LINQ (pronounced Link):
Language INtegrated Query
Language Integrated Query
Simplified, object-oriented way to query
Bridges OOP and relational data
Compile-time checked queries
Provides IntelliSense inside Visual Studio
Unified syntax for querying any data source
Linq to SQL

                                          Classes
 public class Customer { … }            describe data

 public class Northwind : DataContext
                                        Tables are like
 {                                        collections
   public Table<Customer> Customers;
   …
 }                                      Strongly typed
                                         connections
 Northwind db = new Northwind(…);
 var contacts =                          Integrated
   from c in db.Customers               query syntax
   where c.City == "London"
   select new { c.Name, c.Phone };
                                        Strongly typed
                                            results
CAML(Collaborative Application
MarkUp Language)
SPWeb web;
SPQueryquery = newSPQuery();                Queries in
                                             quotes
query.Query= String.Format(“<Where>
<And> <Eq>
<FieldRef Name='LastName' />
<Value Type='Text'>Shakir</Value>
</Eq> <Geq>
<FieldRef Name='Age' />                  Loosely bound
<Value Type='Number'>16</Value>            arguments
</Geq> </And>
</Where>”)                               No compile time
SPListItemCollectionl Coll=                  checks
web.Lists[“Employee”].GetItems(query);
Demo
C# Enhancments for LINQ
 IEnumerable<T>, IQueryable<T>
 Automatic Properties
 Object and Collection Initializers
 Lambda Expressions
 Query Syntax
 Anonymous Types
IEnumerable<T>, IQueryable<T>


   Contained in System.Collections.Generic
   Implemented by the query provider
   Supports a simple iteration or a query against
   that type
   This is what allows LINQ to query
Automatic Properties
  Allows short-hand property declarations
  Compiler emits getters and setters
  Used in LINQ to surface properties

public class Contact {
  public string FirstName { get; set; }
  public string LastName { get; set; }
}
Object and Collection Initializers
//Traditional approach
Contact c= new Contact();
c.FirstName = “shakir";
c.LastName = “majeed ";

//Object Initializer
Contact c= new Contact{ FirstName=“shakir", LastName=“Majeed          "
};

//Collection Initializer
List<Contact> contacts =    new List<Contact>{
 Contact c= new Contact{    FirstName=“shakir", LastName=“majeed"},
 Contact c= new Contact{    FirstName=“aamir", LastName=“majeed" },
 Contact c= new Contact{    FirstName=“zakir", LastName=“majeed" },
};
Lambda Expressions
    Compact way to write anonymous functions



// passing parameter using an anonymous delegate
IEnumerable<Contact> results =
  contacts.Where( delegate(Contact c) {return c.FirstName==“shakir”;} );


// equivalent code using a lambda expression
IEnumerable<Contact> results =
  contacts.Where( c => FirstName=="shakir" );
Query Syntax
   Offers a readable alternative to Method syntax



IEnumerable<Contact> results =
  contacts.Where( c=> FirstName=="shakir");

IEnumerable<Contact> results =
  from c in contacts
  where c.FirstName.Equals("shakir");
Anonymous Types
  Allows developers to use variables without
  declaring the type.
  Still strongly typed, but inferred



var results =
  from c in contacts
  where c.FirstName.Equals("Mike");
Demo
Thank You
Facebook: http://www.facebook.com/shakir.majeed
Blog: http://junooni.wordpress.com/
Email: shakir.majeed@gmail.com

More Related Content

What's hot

Realm Mobile Database - An Introduction
Realm Mobile Database - An IntroductionRealm Mobile Database - An Introduction
Realm Mobile Database - An Introduction
Knoldus Inc.
 
2310 b 12
2310 b 122310 b 12
2310 b 12
Krazy Koder
 
iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디
MINJICHO20
 
Fetch data from form
Fetch data from formFetch data from form
Fetch data from form
Shahriar Malik
 
Elk devops
Elk devopsElk devops
Elk devops
Ideato
 
Simple.Data intro slides
Simple.Data intro slidesSimple.Data intro slides
Simple.Data intro slides
Mark Rendle
 
Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)
Paco de la Cruz
 
Ado object
Ado objectAdo object
Ado object
RajaRajeswari22
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
Paco de la Cruz
 
Parse Advanced
Parse AdvancedParse Advanced
Parse Advanced
Tushar Acharya
 
MongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless WorldMongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless World
MongoDB
 
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and TypescriptMongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB
 
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
Red Hat Developers
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
Sireesh K
 
Durable functions
Durable functionsDurable functions
Durable functions
명신 김
 
Data Binding and Data Grid View Classes
Data Binding and Data Grid View ClassesData Binding and Data Grid View Classes
Data Binding and Data Grid View Classes
Arvind Krishnaa
 
BaasBox - Your mobile backend made easy
BaasBox - Your mobile backend made easyBaasBox - Your mobile backend made easy
BaasBox - Your mobile backend made easy
Commit University
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
Paco de la Cruz
 
Android httpclient php_mysql
Android httpclient php_mysqlAndroid httpclient php_mysql
Android httpclient php_mysql
Chalermchon Samana
 
Chapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & DeitelChapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & Deitel
CSDeptSriKaliswariCo
 

What's hot (20)

Realm Mobile Database - An Introduction
Realm Mobile Database - An IntroductionRealm Mobile Database - An Introduction
Realm Mobile Database - An Introduction
 
2310 b 12
2310 b 122310 b 12
2310 b 12
 
iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디iOS Keychain by 흰, 민디
iOS Keychain by 흰, 민디
 
Fetch data from form
Fetch data from formFetch data from form
Fetch data from form
 
Elk devops
Elk devopsElk devops
Elk devops
 
Simple.Data intro slides
Simple.Data intro slidesSimple.Data intro slides
Simple.Data intro slides
 
Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)
 
Ado object
Ado objectAdo object
Ado object
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
Parse Advanced
Parse AdvancedParse Advanced
Parse Advanced
 
MongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless WorldMongoDB.local Berlin: App development in a Serverless World
MongoDB.local Berlin: App development in a Serverless World
 
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and TypescriptMongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
 
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
Jupyter Notebooks for machine learning on Kubernetes & OpenShift | DevNation ...
 
Asp.net server control
Asp.net  server controlAsp.net  server control
Asp.net server control
 
Durable functions
Durable functionsDurable functions
Durable functions
 
Data Binding and Data Grid View Classes
Data Binding and Data Grid View ClassesData Binding and Data Grid View Classes
Data Binding and Data Grid View Classes
 
BaasBox - Your mobile backend made easy
BaasBox - Your mobile backend made easyBaasBox - Your mobile backend made easy
BaasBox - Your mobile backend made easy
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
 
Android httpclient php_mysql
Android httpclient php_mysqlAndroid httpclient php_mysql
Android httpclient php_mysql
 
Chapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & DeitelChapter 27 Networking - Deitel & Deitel
Chapter 27 Networking - Deitel & Deitel
 

Viewers also liked

GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
Planetek Italia Srl
 
AUC Tech-SP 2010
AUC Tech-SP 2010AUC Tech-SP 2010
AUC Tech-SP 2010
Shakir Majeed Khan
 
Sharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoftSharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoft
Shakir Majeed Khan
 
SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011
Shakir Majeed Khan
 
Sharepoint Online
Sharepoint OnlineSharepoint Online
Sharepoint Online
Shakir Majeed Khan
 
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. BarbieriWorkshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
Planetek Italia Srl
 
UX@Vitra - Experience Continuum
UX@Vitra - Experience ContinuumUX@Vitra - Experience Continuum
UX@Vitra - Experience Continuum
Katrien De Graeve
 
Stug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live EventStug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live Event
Shakir Majeed Khan
 

Viewers also liked (8)

GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
GWT 2014: Smart City Conference - 07 Il ruolo delle tecnologie Geospaziali ne...
 
AUC Tech-SP 2010
AUC Tech-SP 2010AUC Tech-SP 2010
AUC Tech-SP 2010
 
Sharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoftSharepoint developement tools(webparts+worflows) EBizSoft
Sharepoint developement tools(webparts+worflows) EBizSoft
 
SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011SharePoint 2010 and Changing Business Needs-MAJU 2011
SharePoint 2010 and Changing Business Needs-MAJU 2011
 
Sharepoint Online
Sharepoint OnlineSharepoint Online
Sharepoint Online
 
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. BarbieriWorkshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
Workshop - Verso il Piano Regolatore di Ascoli Piceno - 02 - V. Barbieri
 
UX@Vitra - Experience Continuum
UX@Vitra - Experience ContinuumUX@Vitra - Experience Continuum
UX@Vitra - Experience Continuum
 
Stug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live EventStug -Sir Syed University On Location-Live Event
Stug -Sir Syed University On Location-Live Event
 

Similar to Share pointtechies linqtosp-andsbs

Introduction to Linq
Introduction to LinqIntroduction to Linq
Introduction to Linq
Shahriar Hyder
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
Anand Kumar Rajana
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
CHOOSE
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008
Luis Enrique
 
LINQ
LINQLINQ
Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#
Vagif Abilov
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
laxmi.katkar
 
Linq E Ef 1207668728621762 9
Linq E Ef 1207668728621762 9Linq E Ef 1207668728621762 9
Linq E Ef 1207668728621762 9
google
 
Linq intro
Linq introLinq intro
Linq intro
Bình Trọng Án
 
PostThis
PostThisPostThis
PostThis
testingphase
 
B_110500002
B_110500002B_110500002
B_110500002
Vaibhav Chavan
 
Linq
LinqLinq
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
google
 
Ado.Net
Ado.NetAdo.Net
Ado.Net
LiquidHub
 
Greg Demo Slides
Greg Demo SlidesGreg Demo Slides
Greg Demo Slides
Gregory Renard
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
Lambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter LawreyLambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter Lawrey
JAXLondon_Conference
 
Linq
LinqLinq
Linq
ClickExpo
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
Hemant Sankhla
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
MarcinStachniuk
 

Similar to Share pointtechies linqtosp-andsbs (20)

Introduction to Linq
Introduction to LinqIntroduction to Linq
Introduction to Linq
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
 
Visual studio 2008
Visual studio 2008Visual studio 2008
Visual studio 2008
 
LINQ
LINQLINQ
LINQ
 
Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#Typed? Dynamic? Both! Cross-platform DSLs in C#
Typed? Dynamic? Both! Cross-platform DSLs in C#
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
 
Linq E Ef 1207668728621762 9
Linq E Ef 1207668728621762 9Linq E Ef 1207668728621762 9
Linq E Ef 1207668728621762 9
 
Linq intro
Linq introLinq intro
Linq intro
 
PostThis
PostThisPostThis
PostThis
 
B_110500002
B_110500002B_110500002
B_110500002
 
Linq
LinqLinq
Linq
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
 
Ado.Net
Ado.NetAdo.Net
Ado.Net
 
Greg Demo Slides
Greg Demo SlidesGreg Demo Slides
Greg Demo Slides
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Lambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter LawreyLambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter Lawrey
 
Linq
LinqLinq
Linq
 
Database connectivity to sql server asp.net
Database connectivity to sql server asp.netDatabase connectivity to sql server asp.net
Database connectivity to sql server asp.net
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
 

More from Shakir Majeed Khan

STUG-Sand boxed Solution
STUG-Sand boxed SolutionSTUG-Sand boxed Solution
STUG-Sand boxed Solution
Shakir Majeed Khan
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
Shakir Majeed Khan
 
SPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows AzureSPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows Azure
Shakir Majeed Khan
 
SharePoint 2010- Changing business needs
SharePoint 2010- Changing business needsSharePoint 2010- Changing business needs
SharePoint 2010- Changing business needs
Shakir Majeed Khan
 
STUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net DevsSTUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net Devs
Shakir Majeed Khan
 
FCPakistan: a case study
FCPakistan: a case studyFCPakistan: a case study
FCPakistan: a case study
Shakir Majeed Khan
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development tools
Shakir Majeed Khan
 
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on locationMicrosoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Shakir Majeed Khan
 
Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management
Shakir Majeed Khan
 
Sharepoint introanddevelopementtools
Sharepoint introanddevelopementtoolsSharepoint introanddevelopementtools
Sharepoint introanddevelopementtools
Shakir Majeed Khan
 

More from Shakir Majeed Khan (10)

STUG-Sand boxed Solution
STUG-Sand boxed SolutionSTUG-Sand boxed Solution
STUG-Sand boxed Solution
 
STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010STUG-Client Object Model SharePoint 2010
STUG-Client Object Model SharePoint 2010
 
SPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows AzureSPS- Share Point 2010 and Windows Azure
SPS- Share Point 2010 and Windows Azure
 
SharePoint 2010- Changing business needs
SharePoint 2010- Changing business needsSharePoint 2010- Changing business needs
SharePoint 2010- Changing business needs
 
STUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net DevsSTUG- SharePoint 2010 for ASP.net Devs
STUG- SharePoint 2010 for ASP.net Devs
 
FCPakistan: a case study
FCPakistan: a case studyFCPakistan: a case study
FCPakistan: a case study
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development tools
 
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on locationMicrosoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
Microsoft SharePoint Server 2010-STUG- DCS-KU 9 feb live and on location
 
Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management Stug-paf kiet 28 january live and on location-Enterprise Content Management
Stug-paf kiet 28 january live and on location-Enterprise Content Management
 
Sharepoint introanddevelopementtools
Sharepoint introanddevelopementtoolsSharepoint introanddevelopementtools
Sharepoint introanddevelopementtools
 

Recently uploaded

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 

Recently uploaded (20)

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 

Share pointtechies linqtosp-andsbs

  • 1. LinqToSharePoint SandBoxed Solution Shakir Majeed Khan http://sharepointtechies.wordpress.com/
  • 2. MySelf http://junooni.wordpress.com/ shakir.majeed@gmail.com www.facebook.com/shakir.majeed User Group Leader of SharePoint Techies, Working independently on SharePoint technologies. Trainer for Microsoft Office SharePoint Server 2007 and Window SharePoint Services 3.0 at AUC Technologies.
  • 3. Agenda session is divided into two LinqtoSharePoint SandBoxed Solution Questions
  • 4. What’s wrong with this Queries in SqlConnection c = new SqlConnection(…); quotes c.Open(); SqlCommand cmd = new SqlCommand( @"SELECT c.Name, c.Phone Loosely bound FROM Customers c arguments WHERE c.City = @p0"); cmd.Parameters.AddWithValue("@p0", "London“); DataReader dr = c.Execute(cmd); Loosely typed while (dr.Read()) { result sets string name = dr.GetString(0); string phone = dr.GetString(1); DateTime date = dr.GetDateTime(2); No compile time } checks dr.Close();
  • 7. Language Integrated Query Simplified, object-oriented way to query Bridges OOP and relational data Compile-time checked queries Provides IntelliSense inside Visual Studio Unified syntax for querying any data source
  • 8. Linq to SQL Classes public class Customer { … } describe data public class Northwind : DataContext Tables are like { collections public Table<Customer> Customers; … } Strongly typed connections Northwind db = new Northwind(…); var contacts = Integrated from c in db.Customers query syntax where c.City == "London" select new { c.Name, c.Phone }; Strongly typed results
  • 9. CAML(Collaborative Application MarkUp Language) SPWeb web; SPQueryquery = newSPQuery(); Queries in quotes query.Query= String.Format(“<Where> <And> <Eq> <FieldRef Name='LastName' /> <Value Type='Text'>Shakir</Value> </Eq> <Geq> <FieldRef Name='Age' /> Loosely bound <Value Type='Number'>16</Value> arguments </Geq> </And> </Where>”) No compile time SPListItemCollectionl Coll= checks web.Lists[“Employee”].GetItems(query);
  • 10. Demo
  • 11. C# Enhancments for LINQ IEnumerable<T>, IQueryable<T> Automatic Properties Object and Collection Initializers Lambda Expressions Query Syntax Anonymous Types
  • 12. IEnumerable<T>, IQueryable<T> Contained in System.Collections.Generic Implemented by the query provider Supports a simple iteration or a query against that type This is what allows LINQ to query
  • 13. Automatic Properties Allows short-hand property declarations Compiler emits getters and setters Used in LINQ to surface properties public class Contact { public string FirstName { get; set; } public string LastName { get; set; } }
  • 14. Object and Collection Initializers //Traditional approach Contact c= new Contact(); c.FirstName = “shakir"; c.LastName = “majeed "; //Object Initializer Contact c= new Contact{ FirstName=“shakir", LastName=“Majeed " }; //Collection Initializer List<Contact> contacts = new List<Contact>{ Contact c= new Contact{ FirstName=“shakir", LastName=“majeed"}, Contact c= new Contact{ FirstName=“aamir", LastName=“majeed" }, Contact c= new Contact{ FirstName=“zakir", LastName=“majeed" }, };
  • 15. Lambda Expressions Compact way to write anonymous functions // passing parameter using an anonymous delegate IEnumerable<Contact> results = contacts.Where( delegate(Contact c) {return c.FirstName==“shakir”;} ); // equivalent code using a lambda expression IEnumerable<Contact> results = contacts.Where( c => FirstName=="shakir" );
  • 16. Query Syntax Offers a readable alternative to Method syntax IEnumerable<Contact> results = contacts.Where( c=> FirstName=="shakir"); IEnumerable<Contact> results = from c in contacts where c.FirstName.Equals("shakir");
  • 17. Anonymous Types Allows developers to use variables without declaring the type. Still strongly typed, but inferred var results = from c in contacts where c.FirstName.Equals("Mike");
  • 18. Demo
  • 19. Thank You Facebook: http://www.facebook.com/shakir.majeed Blog: http://junooni.wordpress.com/ Email: shakir.majeed@gmail.com

Editor's Notes

  1. This slide shows the language enhancements for C# that directly support LINQ. These enhancements make it possible to write compact LINQ queries in a single statement.
  2. Short hand properties with no member variables
  3. Again, short hand with no member variables
  4. var keyword