LINQ & ADO.NET Entity Framework

Slides:



Advertisements
Similar presentations
Developer Knowledge Sharing Eric Sun Dec, What programming language did you learn in school and since then? Now, its time to refresh …
Advertisements

The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
Extension Methods, Anonymous Types LINQ Query Keywords, Lambda Expressions Svetlin Nakov Telerik Corporation
.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT
C# 3.0 & LINQ Raimond Brookman – IT Architect
LINQ: Language-Integrated Queries (To be included in C # 3.0) Technology developed by Anders Hejlsberg & friends at Microsoft (2005) Presented by Tal Cohen.
2.3 Cool features in C# academy.zariba.com 1. Lecture Content 1.Extension Methods 2.Anonymous Types 3.Delegates 4.Action and Func 5.Events 6.Lambda Expressions.
XML files (with LINQ). Introduction to LINQ ( Language Integrated Query ) C#’s new LINQ capabilities allow you to write query expressions that retrieve.
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
Eric Vogel Software Developer A.J. Boggs & Company.
Advanced .NET Programming I 13th Lecture
C# 3.0 & LINQ 천호민 Visual C# MVP zmeun.tistory.com.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
Entity Framework Overview. Entity Framework A set of technologies in ADO.NET that support the development of data-oriented software applications A component.
Extension Methods, Anonymous Types LINQ Query Keywords, Lambda Expressions Based on material from Telerik Corporation.
Mads Torgersen, Microsoft.  Language INtegrated Query  An open multi-language query facility  Uses cool language stuff  Points into the future.
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
2008.NET iSDC & RONUA Workshop, November 10 th Mark Blomsma Software architect Develop-One.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
Lambda Expressions Version 1.0
C#: Future Directions in Language Innovation Anders Hejlsberg TLN307 Technical Fellow Microsoft Corporation.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 10 th Lecture Pavel Ježek
Inside LINQ to Objects How LINQ to Objects work Inside LINQ1.
Satisfy Your Technical Curiosity C# 3.0 Raj Pai Group Program Manager Microsoft Corporation
Joel Pobar Language Geek Microsoft DEV320 Improve on C# % Backwards Compatible Language Integrated Query (LINQ)
IAP C# 2011 Lecture 2: Delegates, Lambdas, LINQ Geza Kovacs.
Support standard JavaScript code with static typing Encapsulation through classes and modules Support for constructors, properties and.
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
LINQ and Lambda Expressions Telerik Software Academy LINQ Overview.
Generic Programming and Library Design Brian Bartman
Building Web Applications with Microsoft ASP
Static Members and Namespaces
Functional Programming
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Abstract Classes, Abstract Methods, Override Methods
C# Basic Syntax, Visual Studio, Console Input / Output
C# Basic Syntax, Visual Studio, Console Input / Output
Creating and Using Objects, Exceptions, Strings
Linear Data Structures: Stacks and Queues
Lambda Expressions Version 1.1
Tech·Ed North America /18/2018 2:05 PM
Repeating Code Multiple Times
Inheritance Class Hierarchies SoftUni Team Technical Trainers C# OOP
LINQ for SQL SQL Saturday May 2009 David Fekke.
Functional Programming
.NET Framework 2.0 .NET Framework 3.0 .NET Framework 3.5
Regular Expressions (RegEx)
Lambda Expressions By Val Feldsher.
Language Integrated Query: (LINQ) An introduction
LiNQ SQL Saturday David Fekke.
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Iterators and Comparators
Subroutines in Computer Programming
MIS Professor Sandvig MIS 324 Professor Sandvig
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
Using Classes and Objects
Language Integrated Query (LINQ)
Language Integrated Query (LINQ)
Scoping and Binding of Variables
MIS Professor Sandvig MIS 324 Professor Sandvig
Технологии доступа к данным на платформе Microsoft.NET
ADO.NET Entity Framework
LINQ - 2 Ravi Kumar C++/C# Team.
Entity Framework & LINQ (Language Integrated Query)
Advanced .NET Programming I 6th Lecture
C# Language & .NET Platform 3rd Lecture
Presentation transcript:

LINQ & ADO.NET Entity Framework * 1/14/201907/16/96 .NET Team LINQ & ADO.NET Entity Framework Stefan Dobrev GM Avaxo Ltd. http://ligaz.blogspot.com (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Contents LINQ – general stuff LINQ Providers ADO.NET Entity Framework * 1/14/201907/16/96 Contents LINQ – general stuff LINQ Providers ADO.NET Entity Framework (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

Language Integrated Query * 1/14/201907/16/96 LINQ Language Integrated Query (c) 2005 National Academy for Software Development - http://academy.devbg.org. All rights reserved. Unauthorized copying or re-distribution is strictly prohibited.*

DEMO LINQ in Action

Local variable type inference What we saw? Query expressions var func = from l in ProgrammingLanguage.GetAll() where l.Paradigm.HasValue(Functional) select l; Local variable type inference var func = ProgrammingLanguage.GetAll() .Where(l => l.Paradigm.HasValue(Functional)) .Select(l => l); Extension methods Lambda expressions Expression Trees

Local Variable Type Inference int i = 5; string s = "Hello"; double d = 1.0; int[] numbers = new int[] {1, 2, 3}; Dictionary<int,Order> orders = new Dictionary<int,Order>(); var i = 5; var s = "Hello"; var d = 1.0; var numbers = new int[] {1, 2, 3}; var orders = new Dictionary<int,Order>(); Compiler infers the correct type from the right side

Bring extensions into scope Extension Methods obj.Foo(x, y)  XXX.Foo(obj, x, y) namespace ITBoxing { public static class Extensions public static string HasValue( this ProgrammingParadigm paradigm, ProgrammingParadigm value ) return ( paradigm & value ) != 0 } Extension Method Bring extensions into scope using ITBoxing IntelliSense ProgrammingParadigm paradigm = Functional & Imperative; Paradigm.HasValue(Imperative);

Lambda Expressions Lambda expression List<ProgrammingLanguage> langs = ProgrammingLanguage.GetAll(); List<ProgrammingLanguage> cool = langs.FindAll( delegate(ProgrammingLanguage l) { return l.IsCool; } ); List<ProgrammingLanguage> langs = ProgrammingLanguage.GetAll(); List<ProgrammingLanguage> cool = langs.FindAll(l => l.IsCool); Lambda expression

Expression Trees Code as Data public delegate bool Predicate<T>(T item); Expression<Predicate<ProgrammingLanguage>> isCool = l => l.IsCool == true; ParameterExpression l = Expression.Parameter( typeof(ProgrammingLanguage), "l" ); Expression expr = Expression.Equal( Expression.Property(l, typeof(ProgrammingLanguage) .GetProperty("IsCool")), Expression.Constant(true)); Expression<Predicate <ProgrammingLanguage>> isCool = Expression.Lambda <Predicate<ProgrammingLanguage>>(expr, l);

LINQ & ADO.NET Entity Framework Questions?