SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Giving Clarity to LINQ Queries
by Extending Expressions
Are
Do you use
expressions?
Entity Framework & LINQ
Expression<Func<TModel, bool>>
People.Where(p => p.Title == “Developer”)
Automapper
Expression<Func<TSource, object>>
AutoMapper.Mapper.CreateMap<Post, BlogPostView>()
.ForMember(dest => dest.Heading,
opts => opts.MapFrom(src => src.Title));
HTML Helpers
Expression<Func<TModel, TResult>>
@Html.LabelFor(obj => obj.Prop)
Telerik Data Grid
@(Html.Kendo().Grid<Post>
.Columns(columns => {
columns.Bound(p => p.Title);
columns.Bound(p => p.Author);
columns.Bound(p => p.Pubished);
})
)
Expressions in C#
• Representation of code as data
• Meta-programming
– Analyze, rewrite, and translate code at runtime
Homo-iconicity
Same syntax for executable code as data representation
1 //Executable representation
2 Func<int, int> plusOne = n => n + 1;
3
4 //Data representation
5 Expression<Func<int, int>> plusOne = n => n + 1;
Homo-iconicity
Same syntax for executable code as data representation
1 //Executable representation
2 Func<int, int> plusOne = n => n + 1;
3
4 //Data representation
5 Expression<Func<int, int>> plusOne = n => n + 1;
Expression Factory
1 // new Expression() invalid!
2
3 var x = Expression.Constant(1);
1
constant
Expression Factory
1 // new Expression() invalid!
2
3 var x = Expression.Constant(1);
4 var y = Expression.Constant(1);
1
constant
1
constant
Expression Factory
1 // new Expression() invalid!
2
3 var x = Expression.Constant(1);
4 var y = Expression.Constant(1);
5 var sum = Expression.Add(x,y); +
11
Add
constant constant
Expression Factory
1 // new Expression() invalid!
2
3 var x = Expression.Constant(1);
4 var y = Expression.Constant(1);
5 var sum = Expression.Add(x,y);
6
7 Console.WriteLine(sum);
8 // (1 + 1)
9
10 Console.WriteLine(sum.GetType());
11 // SimpleBinaryExpression
+
11
Add
constant constant
SimpleBinaryExpression
Compile
1 Expression<Func<int, int>> plusOne = n => n + 1;
2 Console.WriteLine(plusOne.ToString());
3 // n => (n + 1)
Compile
1 Expression<Func<int, int>> plusOne = n => n + 1;
2 Console.WriteLine(plusOne.ToString());
3 // n => (n + 1)
4
5 var x = plusOne.Compile();
6 Console.WriteLine(x(1));
7 // 2
Runtime Modification
ExpressionVisitor
• used to traverse or rewrite expression trees
• Abstract class
– Inherit and override
• .Visit(expression)
– Recursively walks the tree
– Returns an Expression
https://msdn.microsoft.com/en-us/library/bb882521(v=vs.90).aspx
Are
OMG He’s
showing docs
in a
presentation
Are
How is this
useful?
Pipeline
Pipes and filters
Filter
Rule Rule
Data
Data
Data
Consumer
Results
Database Filter
Rule Rule
dbContext.Where(rule).Where(rule)
Maintainability & Readability
Refactoring
What’s
going
on here?
1 postRepository.GetAll()
2 .Where(post => post.IsPublished &&
3 post.PostedOn <= today &&
4 (post.PostedOn >= cutoffDate ||
5 post.Author == featuredAuthor &&
6 post.PostedOn >= featuredAuthorCutoffDate));
Let’s start simple
What’s
going on
here?
1 postRepository.GetAll()
2 .Where(post => post.IsPublished && post.PostedOn <= today);
Distinction
The tale of two extension methods
IEnumerable.Where(q => q.Value == true)
Function delegate
Func<T, bool>
IQueryable.Where(q => q.Value == true)
Expression
Expression<Func<T, bool>
LINQ Where Chaining
1 //Both statements produce the same result
2
3 //Concise
4 var query = query.Where(x => x.Value == 1 && x.Name == ”foo”);
5
6 //Configurable
7 var query = query.Where(x => x.Value == 1)
8 .Where(x => x.Name == ”foo”);
SELECT x
FROM table
WHERE (value = 1 AND name = ‘foo’)
LINQ Where Chaining
1 var query = query.Where(x => x.Value == 1);
SELECT x
FROM table
WHERE (value = 1)
=>
x
==
value 1
LINQ Where Chaining
1 var query = query.Where(x => x.Value == 1)
2 .Where(x => x.Name == ”foo”);
SELECT x
FROM table
WHERE (value = 1 AND name = ‘foo’)
&&
=>
x
==
name foo
==
value 1
LINQ Where Chaining
1 var query = query.Where(x => x.Value == 1);
2 query.Where(x => x.Name == ”foo”);
3 query.Where(x => x.IsDeleted == ”true”);
SELECT x
FROM table
WHERE (value = 1 AND name = ‘foo’ AND IsDeleted = 1)
&&
=>
x
==
name foo
==
value 1
&&
==
isDeleted
1
Custom Filters
Extends type
IQueryable<MyType>
Return type
IQueryable<MyType>
Method
.CustomMethodName()
public static IQueryable<Post> ArePublished(this IQueryable<Post> posts)
{
return posts.Where(post => post.IsPublished);
}
1 postRepository.GetAll()
2 .Where(post => post.IsPublished &&
3 post.PostedOn <= today);
Readability?
Before After
What’s
the
intent?
1 postRepository.GetAll()
2 .ArePublished()
3 .PostedOnOrBefore(today);
Now what?
What’s
the
intent?
1 IQueryable<Post> posts = postRepository.GetAll()
2 .Where(post => post.IsPublished && post.PostedOn <= today &&
3 (post.PostedOn >= cutoffDate || post.Author == featuredAuthor &&
4 post.PostedOn >= featuredAuthorCutoffDate));
Lambda as an Expression tree
post => post.PostedOn >= cutoffDate
>=
cutoffDatePostedOn
GreaterThanOrEqual
=>
post
Lambda
parameter
parameter constant
Body
Lambda as an Expression tree
post => post.PostedOn >= cutoffDate
>=
cutoffDatePostedOn
GreaterThanOrEqual
=>
post
Lambda
parameter
parameter constant
Body
Lambda as an Expression tree
post => post.PostedOn >= cutoffDate
>=
cutoffDatePostedOn
GreaterThanOrEqual
=>
post
Lambda
parameter
parameter constant
Body
Combine Like Expressions?
>=
=>
post
Body
==
=>
post
Body
AND / OR?
CombineLambdas
>=
constantPost.Property
=>
post
Body
==
constantPost.Property
=>
post
Body
AND / OR?
CombineLambdas(left, right, ExpressionType.AndAlso)
Get Paramters
>=
constantPost.Property
=>
post
Body
==
constantPost.Property
=>
post
Body
SubstituteParameterVisitor(left.Parameters[0], right.Parameters[0])
Replace Parameters
>=
constantPost.Property
Body
==
constantPost.Property
post
Body
post
Post.Property
SubstitutionVisitor.VisitParameter
Combined Expressions
=>
post
Lambda
parameter
Body
>=
&&
==
Expression.MakeBinary
Expression.Lambda<Func<T, bool>>
Readability?
Before
After
1 postRepository.GetAll()
2 .Where(post => post.IsPublished && post.PostedOn <= today &&
3 (post.PostedOn >= cutoffDate || post.Author == featuredAuthor &&
4 post.PostedOn >= featuredAuthorCutoffDate));
1 postRepository.GetAll()
2 .ArePublished()
3 .PostedOnOrBefore(today)
4 .Where(PostedOnOrAfter(cutoffDate)
5 .Or(FeaturedAuthorPostedrOnOrAfter(featuredAuthor,featuredAuthorCutoffDate)));
New Requirements!
Now we must support multiple featured authors
Dynamic
LINQ query?
No problem, now we’re equipped for it!
Dynamic Queries
Try this without expressions.
1 var rule = PredicateExtensions.PredicateExtensions.Begin<Post>();
2 foreach (var authorName in featuredAuthorNames)
3 {
4 rule = rule.Or(FeaturedAuthorPostedOnOrAfter(authorName, featuredAuthorCutoffDate));
5 }
6 return rule;
Dynamic Expression
Left
Body.NodeType == ExpressionType.Constant
Right
if (IsExpressionBodyConstant(left)) return (right);
>=
constantPost.Property
=>
post
Body
bool true
Are
Questions?
Ed Charbeneau
Developer Advocate for Progress<Telerik>
Author<T>
Podcast => “Eat Sleep Code the Official Telerik Podcast”
Twitter.Where(user = @EdCharbeneau)
Resources
• Article
– https://goo.gl/kAM05P
• GitHub
– https://github.com/EdCharbeneau/PredicateExtensions
• Telerik
– www.Telerik.com
• Twitter
– @EdCharbeneau

Weitere ähnliche Inhalte

Was ist angesagt?

Immutability, and how to do it in JavaScripts
Immutability, and how to do it in JavaScriptsImmutability, and how to do it in JavaScripts
Immutability, and how to do it in JavaScriptsAnton Astashov
 
Java script objects 1
Java script objects 1Java script objects 1
Java script objects 1H K
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in pythonhydpy
 
Introduction to python programming 1
Introduction to python programming   1Introduction to python programming   1
Introduction to python programming 1Giovanni Della Lunga
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2Giovanni Della Lunga
 
The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196Mahmoud Samir Fayed
 
Aggregation Function in Druid
Aggregation Function in DruidAggregation Function in Druid
Aggregation Function in DruidNavis Ryu
 
Introduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBIntroduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBBehrouz Bakhtiari
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)Christopher Roach
 
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCEFUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCEVenugopalavarma Raja
 
Python Datatypes by SujithKumar
Python Datatypes by SujithKumarPython Datatypes by SujithKumar
Python Datatypes by SujithKumarSujith Kumar
 
Python tutorialfeb152012
Python tutorialfeb152012Python tutorialfeb152012
Python tutorialfeb152012Shani729
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...sachin kumar
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2RajKumar Rampelli
 
Java chapter 6 - Arrays -syntax and use
Java chapter 6 - Arrays -syntax and useJava chapter 6 - Arrays -syntax and use
Java chapter 6 - Arrays -syntax and useMukesh Tekwani
 

Was ist angesagt? (20)

Scala - en bedre Java?
Scala - en bedre Java?Scala - en bedre Java?
Scala - en bedre Java?
 
Immutability, and how to do it in JavaScripts
Immutability, and how to do it in JavaScriptsImmutability, and how to do it in JavaScripts
Immutability, and how to do it in JavaScripts
 
Java script objects 1
Java script objects 1Java script objects 1
Java script objects 1
 
Datastructures in python
Datastructures in pythonDatastructures in python
Datastructures in python
 
Introduction to python programming 1
Introduction to python programming   1Introduction to python programming   1
Introduction to python programming 1
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2
 
The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196The Ring programming language version 1.7 book - Part 39 of 196
The Ring programming language version 1.7 book - Part 39 of 196
 
Aggregation Function in Druid
Aggregation Function in DruidAggregation Function in Druid
Aggregation Function in Druid
 
Introduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDBIntroduction to NOSQL And MongoDB
Introduction to NOSQL And MongoDB
 
python and database
python and databasepython and database
python and database
 
R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)R for Pythonistas (PyData NYC 2017)
R for Pythonistas (PyData NYC 2017)
 
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCEFUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
FUNCTIONS IN PYTHON. CBSE +2 COMPUTER SCIENCE
 
Python Training
Python TrainingPython Training
Python Training
 
C# p9
C# p9C# p9
C# p9
 
Python Datatypes by SujithKumar
Python Datatypes by SujithKumarPython Datatypes by SujithKumar
Python Datatypes by SujithKumar
 
Ggplot2 v3
Ggplot2 v3Ggplot2 v3
Ggplot2 v3
 
Python tutorialfeb152012
Python tutorialfeb152012Python tutorialfeb152012
Python tutorialfeb152012
 
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
Psycopg2 postgres python DDL Operaytions (select , Insert , update, create ta...
 
Learn python - for beginners - part-2
Learn python - for beginners - part-2Learn python - for beginners - part-2
Learn python - for beginners - part-2
 
Java chapter 6 - Arrays -syntax and use
Java chapter 6 - Arrays -syntax and useJava chapter 6 - Arrays -syntax and use
Java chapter 6 - Arrays -syntax and use
 

Ähnlich wie Giving Clarity to LINQ Queries by Extending Expressions R2

Fuel Up JavaScript with Functional Programming
Fuel Up JavaScript with Functional ProgrammingFuel Up JavaScript with Functional Programming
Fuel Up JavaScript with Functional ProgrammingShine Xavier
 
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression TreesExploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Treesrasmuskl
 
Php Training Canada
Php Training CanadaPhp Training Canada
Php Training CanadaShaheel Khan
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012Timo Westkämper
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lispelliando dias
 
Giving Clarity to LINQ Queries by Extending Expressions
Giving Clarity to LINQ Queries by Extending ExpressionsGiving Clarity to LINQ Queries by Extending Expressions
Giving Clarity to LINQ Queries by Extending ExpressionsEd Charbeneau
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?Amir Barylko
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...Maulik Borsaniya
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxpetabridge
 
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerDeep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerSpark Summit
 
Tamir Dresher - Reactive Extensions (Rx) 101
Tamir Dresher - Reactive Extensions (Rx) 101Tamir Dresher - Reactive Extensions (Rx) 101
Tamir Dresher - Reactive Extensions (Rx) 101Codemotion
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir DresherTamir Dresher
 
Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Evil Martians
 
React.js Basics - ConvergeSE 2015
React.js Basics - ConvergeSE 2015React.js Basics - ConvergeSE 2015
React.js Basics - ConvergeSE 2015Robert Pearce
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with ScalaOto Brglez
 

Ähnlich wie Giving Clarity to LINQ Queries by Extending Expressions R2 (20)

Fuel Up JavaScript with Functional Programming
Fuel Up JavaScript with Functional ProgrammingFuel Up JavaScript with Functional Programming
Fuel Up JavaScript with Functional Programming
 
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression TreesExploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
 
Php Training Canada
Php Training CanadaPhp Training Canada
Php Training Canada
 
Querydsl fin jug - june 2012
Querydsl   fin jug - june 2012Querydsl   fin jug - june 2012
Querydsl fin jug - june 2012
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
Advance python
Advance pythonAdvance python
Advance python
 
Giving Clarity to LINQ Queries by Extending Expressions
Giving Clarity to LINQ Queries by Extending ExpressionsGiving Clarity to LINQ Queries by Extending Expressions
Giving Clarity to LINQ Queries by Extending Expressions
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
C# - What's next
C# - What's nextC# - What's next
C# - What's next
 
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...PYTHON -Chapter 2 - Functions,   Exception, Modules  and    Files -MAULIK BOR...
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
 
Magento code audit
Magento code auditMagento code audit
Magento code audit
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
 
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S OptimizerDeep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
Deep Dive Into Catalyst: Apache Spark 2.0'S Optimizer
 
Tamir Dresher - Reactive Extensions (Rx) 101
Tamir Dresher - Reactive Extensions (Rx) 101Tamir Dresher - Reactive Extensions (Rx) 101
Tamir Dresher - Reactive Extensions (Rx) 101
 
Rx 101 Codemotion Milan 2015 - Tamir Dresher
Rx 101   Codemotion Milan 2015 - Tamir DresherRx 101   Codemotion Milan 2015 - Tamir Dresher
Rx 101 Codemotion Milan 2015 - Tamir Dresher
 
Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1Timothy N. Tsvetkov, Rails 3.1
Timothy N. Tsvetkov, Rails 3.1
 
React.js Basics - ConvergeSE 2015
React.js Basics - ConvergeSE 2015React.js Basics - ConvergeSE 2015
React.js Basics - ConvergeSE 2015
 
Akka with Scala
Akka with ScalaAkka with Scala
Akka with Scala
 

Mehr von Ed Charbeneau

Writing JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxWriting JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxEd Charbeneau
 
Blazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof ApplicationsBlazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof ApplicationsEd Charbeneau
 
Secrets of a Blazor Component Artisan (v2)
Secrets of a Blazor Component Artisan (v2)Secrets of a Blazor Component Artisan (v2)
Secrets of a Blazor Component Artisan (v2)Ed Charbeneau
 
Modernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxModernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxEd Charbeneau
 
Modernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxModernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxEd Charbeneau
 
Secrets of a Blazor Component Artisan
Secrets of a Blazor Component ArtisanSecrets of a Blazor Component Artisan
Secrets of a Blazor Component ArtisanEd Charbeneau
 
Writing java script for Csharp's Blazor
Writing java script for Csharp's BlazorWriting java script for Csharp's Blazor
Writing java script for Csharp's BlazorEd Charbeneau
 
Goodbye JavaScript Hello Blazor
Goodbye JavaScript Hello BlazorGoodbye JavaScript Hello Blazor
Goodbye JavaScript Hello BlazorEd Charbeneau
 
Razor into the Razor'verse
Razor into the Razor'verseRazor into the Razor'verse
Razor into the Razor'verseEd Charbeneau
 
The future of .NET lightning talk
The future of .NET lightning talkThe future of .NET lightning talk
The future of .NET lightning talkEd Charbeneau
 
Into the next dimension
Into the next dimensionInto the next dimension
Into the next dimensionEd Charbeneau
 
What is new in Q2 2015
What is new in Q2 2015What is new in Q2 2015
What is new in Q2 2015Ed Charbeneau
 
TelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXTelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXEd Charbeneau
 
Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Ed Charbeneau
 
Don't be a stereotype: Rapid Prototype
Don't be a stereotype: Rapid PrototypeDon't be a stereotype: Rapid Prototype
Don't be a stereotype: Rapid PrototypeEd Charbeneau
 
A crash course in responsive design
A crash course in responsive designA crash course in responsive design
A crash course in responsive designEd Charbeneau
 

Mehr von Ed Charbeneau (19)

Writing JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptxWriting JavaScript for C# Blazor.pptx
Writing JavaScript for C# Blazor.pptx
 
Blazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof ApplicationsBlazor Stability Testing Tools for Bullet Proof Applications
Blazor Stability Testing Tools for Bullet Proof Applications
 
Secrets of a Blazor Component Artisan (v2)
Secrets of a Blazor Component Artisan (v2)Secrets of a Blazor Component Artisan (v2)
Secrets of a Blazor Component Artisan (v2)
 
Modernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxModernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptx
 
Modernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptxModernizing Web Apps with .NET 6.pptx
Modernizing Web Apps with .NET 6.pptx
 
Blazor Full-Stack
Blazor Full-StackBlazor Full-Stack
Blazor Full-Stack
 
Secrets of a Blazor Component Artisan
Secrets of a Blazor Component ArtisanSecrets of a Blazor Component Artisan
Secrets of a Blazor Component Artisan
 
Writing java script for Csharp's Blazor
Writing java script for Csharp's BlazorWriting java script for Csharp's Blazor
Writing java script for Csharp's Blazor
 
Goodbye JavaScript Hello Blazor
Goodbye JavaScript Hello BlazorGoodbye JavaScript Hello Blazor
Goodbye JavaScript Hello Blazor
 
Razor into the Razor'verse
Razor into the Razor'verseRazor into the Razor'verse
Razor into the Razor'verse
 
Blazor
BlazorBlazor
Blazor
 
The future of .NET lightning talk
The future of .NET lightning talkThe future of .NET lightning talk
The future of .NET lightning talk
 
Into the next dimension
Into the next dimensionInto the next dimension
Into the next dimension
 
What is new in Q2 2015
What is new in Q2 2015What is new in Q2 2015
What is new in Q2 2015
 
TelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAXTelerikNEXT What's new in UI for ASP.NET AJAX
TelerikNEXT What's new in UI for ASP.NET AJAX
 
Journey to JavaScript (from C#)
Journey to JavaScript (from C#)Journey to JavaScript (from C#)
Journey to JavaScript (from C#)
 
Refactoring css
Refactoring cssRefactoring css
Refactoring css
 
Don't be a stereotype: Rapid Prototype
Don't be a stereotype: Rapid PrototypeDon't be a stereotype: Rapid Prototype
Don't be a stereotype: Rapid Prototype
 
A crash course in responsive design
A crash course in responsive designA crash course in responsive design
A crash course in responsive design
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Giving Clarity to LINQ Queries by Extending Expressions R2

Hinweis der Redaktion

  1. https://dotnetfiddle.net/r5UyK0
  2. https://dotnetfiddle.net/r5UyK0
  3. https://dotnetfiddle.net/r5UyK0
  4. https://dotnetfiddle.net/r5UyK0
  5. https://dotnetfiddle.net/kE2uaf
  6. https://dotnetfiddle.net/kE2uaf
  7. https://dotnetfiddle.net/9a53zl
  8. step-1
  9. step-1
  10. Step-2
  11. Step-2
  12. Step-2
  13. Step-2
  14. Step-3
  15. step-4
  16. Step-5 (intended to fail / not compile)
  17. Step-5 (intended to fail / not compile)
  18. Step-5 (intended to fail / not compile)
  19. https://dotnetfiddle.net/9a53zl
  20. Replaces all {post} instances with the same post parameter on both left and right expressions.
  21. Step-6
  22. Step-7 (refactor)
  23. Step-8
  24. This facilitates the Begin<T> method of the predicate extension. This part of the code strips off the => true constant expression from the left side.