This document discusses integrating AngularJS, ASP.NET Web API, SignalR, and Entity Framework. It begins with an overview of object-relational mapping and Entity Framework. It then demonstrates how to develop an ASP.NET Web API with Entity Framework using Code First migrations to initialize and seed a database. Different data loading strategies like eager, lazy, and explicit loading are explained. Issues with navigation properties and circular references are addressed. The document also covers creating DTOs, mapping entities to DTOs with LINQ and AutoMapper, and integrating everything into a real-time dashboard using SignalR with Entity Framework backend.
進擊的 ASP.NET Web API 2 巨人 – 打造支援各種裝置及平台的服務
你/妳知道WebApi (REST)己經成為一個企業IT系統整合及網路服務成長最為快速的趨勢嗎? 你/妳知道現今在網路上最被Mobile device使所用的資料交換的格式是JSON (Javascript Object Notation)而不再是肥大擁腫的XML怪獸嗎?
全世界的網路大咖都拼命地開發WebApi的服務來吸引Mobile或Web application的開發者, 我們將在這堂課中結合AngularJs與ASP.NET Web API 2來讓大家開始感受WebApi的吸引力。
More and more web application is adopting "Single Page Application (SPA)" style to improve user experience (UX). There are many different SPA framework out there, however AngularJS leading by Google really stand out, not only because it can dramatically reduce the developing effort, but also it can improve the maintainability, testability and efficiency. In this tutorial, it will demonstrates the fundamentals features of AngularJS with easy to follow sample pages. All the source code could be found on GitHub: https://github.com/erhwenkuo/PracticalCoding
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
Single-page Applications (SPA) are all the rage these days and with them there is an avalanche of new tools, libraries and frameworks we need to know. But what does this mean for us as Spring developers? In this session we will give you an overview of the current landscape and illustrate the choices the Spring XD team has made for its user interface. What do I use to write SPA applications? How do I integrate them into existing Spring-based backends? How do I build them? Can I integrate them into my existing Gradle or Maven build processes in order to achieve complete build automation? How do I integrate realtime messaging using Spring's SockJS/WebSocket support? In this talk we will answer these and many more questions. We will cover frameworks such as AngularJS, Bootstrap, RequireJS; tools like Bower, Grunt, Gulp; and also talk about testing using Karma and Protractor.
From the AJUG meeting: http://www.meetup.com/atlantajug/events/222312943/
Oc 20, 2015
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules
進擊的 ASP.NET Web API 2 巨人 – 打造支援各種裝置及平台的服務
你/妳知道WebApi (REST)己經成為一個企業IT系統整合及網路服務成長最為快速的趨勢嗎? 你/妳知道現今在網路上最被Mobile device使所用的資料交換的格式是JSON (Javascript Object Notation)而不再是肥大擁腫的XML怪獸嗎?
全世界的網路大咖都拼命地開發WebApi的服務來吸引Mobile或Web application的開發者, 我們將在這堂課中結合AngularJs與ASP.NET Web API 2來讓大家開始感受WebApi的吸引力。
More and more web application is adopting "Single Page Application (SPA)" style to improve user experience (UX). There are many different SPA framework out there, however AngularJS leading by Google really stand out, not only because it can dramatically reduce the developing effort, but also it can improve the maintainability, testability and efficiency. In this tutorial, it will demonstrates the fundamentals features of AngularJS with easy to follow sample pages. All the source code could be found on GitHub: https://github.com/erhwenkuo/PracticalCoding
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
Single-page Applications (SPA) are all the rage these days and with them there is an avalanche of new tools, libraries and frameworks we need to know. But what does this mean for us as Spring developers? In this session we will give you an overview of the current landscape and illustrate the choices the Spring XD team has made for its user interface. What do I use to write SPA applications? How do I integrate them into existing Spring-based backends? How do I build them? Can I integrate them into my existing Gradle or Maven build processes in order to achieve complete build automation? How do I integrate realtime messaging using Spring's SockJS/WebSocket support? In this talk we will answer these and many more questions. We will cover frameworks such as AngularJS, Bootstrap, RequireJS; tools like Bower, Grunt, Gulp; and also talk about testing using Karma and Protractor.
From the AJUG meeting: http://www.meetup.com/atlantajug/events/222312943/
Oc 20, 2015
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules.
In this presentation we will examine various scalability options in order to improve the robustness and performance of your Spring Batch applications. We start out with a single threaded Spring Batch application that we will refactor so we can demonstrate how to run it using:
* Concurrent Steps
* Remote Chunking
* AsyncItemProcessor and AsyncItemWriter
* Remote Partitioning
Additionally, we will show how you can deploy Spring Batch applications to Spring XD which provides high availability and failover capabilities. Spring XD also allows you to integrate Spring Batch applications with other Big Data processing needs.
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norrismfrancis
OSGi DevCon 2008
NASA has been using the Eclipse Rich Client Platform (RCP) as the foundation for many of its rover operations tools for several years. Recently, we started using the Equinox project to extend our applications to the server as well. Along the way, we discovered REST, an intuitive, lightweight methodology for building web applications. In this tutorial, we will share the techniques that we have learned to combine these technologies into web services that are easy to develop, deploy, and use.
This tutorial will be focused on an entertaining set of space-related hands-on exercises that will teach participants to develop, integrate and deploy RESTful web applications on top of OSGI. Participants will walk away with an example RCP application and its Equinox server side support, along with an understanding of how each component functions. The presentation will also discuss issues associated with maintaining the server side code, securing the web applications, and performance. We will be deploying web based services through extension points, so the users will also be able to extend the example project to integrate additional web-services or use the skeleton for their own server side application. We will finally deploy the application to a tomcat server for production usage.
This tutorial will provide a hands-on demonstration of how Equinox and the Restlet framework make a unique combination that takes advantage of the powerful features offered by OSGI and the simplicity offered by REST. Web based services can offer a new whole new set of features to complement an RCP application, and we will demonstrate how simple this can be with a solid and battle tested framework behind the web applications.
Audience
We recommend that audience members have basic familiarity with plugin development and come prepared to code. Audience members without development experience will gain background information on evaluating Equinox for the architecture of their web based applications.
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
Space is a team tool that integrates chats, meetings, git hosting, automation, and more. It has an HTTP API to integrate third party apps and workflows, but it's massive! And slightly opinionated.
In this session, we will see how we built the .NET SDK for Space, and how we make that massive API more digestible. We will see how we used code generation, and incrementally made the API feel more like a real .NET SDK.
S2GX 2012 - Spring Projects InfrastructureGunnar Hillert
Over the last year a number of significant changes have been made to the infrastructure and processes used within the Spring family of projects. In this presentation we will review these process changes and provide valuable insights into the tools that make it all possible. We will begin with providing a brief history, then move on to discuss the new tools being used, such as GitHub, Gradle, and Artifactory. Beyond describing the tools, we'll also illustrate how these new tools help facilitate our processes, including community contributions, release management, defect tracking, and more. Ultimately, this presentation will paint a larger picture of the development process for open source projects at Spring, and the various outlets available for community involvement.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
Developing Azure Functions for Flow and Nintex SPS SD 2018DocFluix, LLC
Demonstration of creating custom REST APIs using Azure Functions that may be consumed by workflow applications such as Nintex Workflow Cloud and Microsoft Flow. Shows how to create a custom, but reusable workflow action (Connector) that workflow designers can embed in their workflows.
Review of Craft CMS v3.3 release and how it helps Headless web applications. Will show a small tutorial courtesy of NYStudio107 of a VueJS, Craft and GraphQL application.
In this fully-loaded session we will give you an update on all things Spring. We will talk about the latest features in Spring Framework 4.2 which was released this summer, and also provide an outlook to what is coming with Spring 5 in 2016.
Next, Spring Boot 1.3 is on the horizon and adds many new features. We will go over those and explain how Spring Boot helps you build production-ready Spring applications.
And then we add Spring Cloud to the mix and explain the various modules.
In this presentation we will examine various scalability options in order to improve the robustness and performance of your Spring Batch applications. We start out with a single threaded Spring Batch application that we will refactor so we can demonstrate how to run it using:
* Concurrent Steps
* Remote Chunking
* AsyncItemProcessor and AsyncItemWriter
* Remote Partitioning
Additionally, we will show how you can deploy Spring Batch applications to Spring XD which provides high availability and failover capabilities. Spring XD also allows you to integrate Spring Batch applications with other Big Data processing needs.
RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norrismfrancis
OSGi DevCon 2008
NASA has been using the Eclipse Rich Client Platform (RCP) as the foundation for many of its rover operations tools for several years. Recently, we started using the Equinox project to extend our applications to the server as well. Along the way, we discovered REST, an intuitive, lightweight methodology for building web applications. In this tutorial, we will share the techniques that we have learned to combine these technologies into web services that are easy to develop, deploy, and use.
This tutorial will be focused on an entertaining set of space-related hands-on exercises that will teach participants to develop, integrate and deploy RESTful web applications on top of OSGI. Participants will walk away with an example RCP application and its Equinox server side support, along with an understanding of how each component functions. The presentation will also discuss issues associated with maintaining the server side code, securing the web applications, and performance. We will be deploying web based services through extension points, so the users will also be able to extend the example project to integrate additional web-services or use the skeleton for their own server side application. We will finally deploy the application to a tomcat server for production usage.
This tutorial will provide a hands-on demonstration of how Equinox and the Restlet framework make a unique combination that takes advantage of the powerful features offered by OSGI and the simplicity offered by REST. Web based services can offer a new whole new set of features to complement an RCP application, and we will demonstrate how simple this can be with a solid and battle tested framework behind the web applications.
Audience
We recommend that audience members have basic familiarity with plugin development and come prepared to code. Audience members without development experience will gain background information on evaluating Equinox for the architecture of their web based applications.
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
Space is a team tool that integrates chats, meetings, git hosting, automation, and more. It has an HTTP API to integrate third party apps and workflows, but it's massive! And slightly opinionated.
In this session, we will see how we built the .NET SDK for Space, and how we make that massive API more digestible. We will see how we used code generation, and incrementally made the API feel more like a real .NET SDK.
S2GX 2012 - Spring Projects InfrastructureGunnar Hillert
Over the last year a number of significant changes have been made to the infrastructure and processes used within the Spring family of projects. In this presentation we will review these process changes and provide valuable insights into the tools that make it all possible. We will begin with providing a brief history, then move on to discuss the new tools being used, such as GitHub, Gradle, and Artifactory. Beyond describing the tools, we'll also illustrate how these new tools help facilitate our processes, including community contributions, release management, defect tracking, and more. Ultimately, this presentation will paint a larger picture of the development process for open source projects at Spring, and the various outlets available for community involvement.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
Developing Azure Functions for Flow and Nintex SPS SD 2018DocFluix, LLC
Demonstration of creating custom REST APIs using Azure Functions that may be consumed by workflow applications such as Nintex Workflow Cloud and Microsoft Flow. Shows how to create a custom, but reusable workflow action (Connector) that workflow designers can embed in their workflows.
Review of Craft CMS v3.3 release and how it helps Headless web applications. Will show a small tutorial courtesy of NYStudio107 of a VueJS, Craft and GraphQL application.
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
We will talk about all aspects of building a single page application with AngularJS, and we will discuss real examples from day-to-day work. We will also cover a large amount of theory about general web development, best practices, and today's client demands. We will focus on three (3) main points: architecture, security, and real time notification.
The web has changed! Users spend more time on mobile than on desktops and expect to have an amazing user experience on both. APIs are the heart of the new web as the central point of access data, encapsulating logic and providing the same data and same features for desktops and mobiles. In this workshop, Antonio will show you how to create complex APIs in an easy and quick way using API Platform built on Symfony.
Learn Entity Framework in a day with Code First, Model First and Database FirstJibran Rasheed Khan
Learn Entity Framework in a day with Code First, Model First and Database First
•Introduction to Entity Framework (EF)
•Architecture
•What’s new!
•Different approaches to work with (Code first, Database first and model first)
•Choosing right work model
•Pictorial Tour to each model
•Features & Advantages
•Question & Answer
for any help and understanding feel free to contact
thank you
Entity framework core v3 from sql to no sqlAndrea Tosato
Entity framework core v3, from SQL to NoSql.
Marco Minerva and Andrea Tosato samples: https://github.com/andreatosato/Entity-FrameworkCore3-from-SQL-2-NoSQL
Frame - Feature Management for Productive Machine LearningDavid Stein
Presented at the ML Platforms Meetup at Pinterest HQ in San Francisco on August 16, 2018.
Abstract: At LinkedIn we observed that much of the complexity in our machine learning applications was in their feature preparation workflows. To address this problem, we built Frame, a shared virtual feature store that provides a unified abstraction layer for accessing features by name. Frame removes the need for feature consumers to deal directly with underlying data sources, which are often different across computing environments. By simplifying feature preparation, Frame has made ML applications at LinkedIn easier to build, modify, and understand.
Presentation for Stichting DotNed in 2015:
Microsoft neemt ASP.NET op de schop. Het web applicatie framework uit .NET 1.0 wordt grotendeels herschreven om te voldoen aan de eisen die men tegenwoordig stelt aan het realiseren van een moderne web applicatie. Deze sessie kijken we naar de nieuwe opzet van ASP.NET. We zien hoe Microsoft daarmee een cloud geoptimaliseerd, cross-platform framework creeert, dat zij zelf sneller kunnen laten evolueren door kortere release cycles. Dit alles betekent wel dat ASP.NET anders is geworden. In deze sessie leer je daarom ook wat er is veranderd, hoe je aan de slag gaat en waarom ASP.NET vNext een revolutionaire stap is in Microsoft's framework.
Lightning web components are custom HTML elements built using HTML and modern JavaScript. Lightning Web Components uses core Web Components standards and provides only what’s necessary to perform well in browsers supported by Salesforce.
Kubernetes Pod 是有生命週期的,它們可以被創建,也可以被銷毀,然而一旦被銷毀生命就永遠結束。通過 ReplicaSets 能夠動態地創建和銷毀 Pod(例如,需要進行擴縮容,或者執行 滾動升級)。每個 Pod 都會獲取它自己的 IP 地址,即使這些 IP 地址不總是穩定可依賴的。這會導致一個問題:在 Kubernetes 集群中,如果一組 Pod(稱為 backend)為其它 Pod (稱為 frontend)提供服務,那麼那些 frontend 該如何發現,並連接到這組 Pod 中的哪些 backend 呢?
Kubernetes Service 定義了這樣一種抽象:邏輯上的一組 Pod,一種可以訪問它們的策略。這一組 Pod 能夠被 Service 訪問到,通常是通過 Label Selector實現的。
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
6. Introduction to Object-Relational
Mapping (ORM)
• Object-Relational Mapping (ORM) is a programming technique for
automatic mapping and converting data
• Between relational database tables and object-oriented classes and
objects
• ORM creates a "virtual object database“
• Which can be used from within the programming language, e.g. C# or
Java
• ORM frameworks automate the ORM process
• A.k.a. object-relational persistence frameworks
7. Functionality of ORM
• ORM frameworks typically provide the following functionality:
• Creating object model by database schema
• Creating database schema by object model
• Querying data by object-oriented API
• Data manipulation operations
• CRUD – create, retrieve, update, delete
• ORM frameworks automatically generate SQL to perform the
requested data operations
9. ORM Advantages
• Developer productivity
• Writing less code
• Abstract from differences between object and relational world
• Complexity hidden within ORM
• Manageability of the CRUD operations for complex relationships
• Easier maintainability
11. Overview of EF
• Entity Framework (EF) is a standard ORM framework, part of .NET
• Provides a run-time infrastructure for managing SQL-based database
data as .NET objects
• The relational database schema is mapped to an object model
(classes and associations)
• Visual Studio has built-in tools for generating Entity Framework SQL data
mappings
• Data mappings consist of C# classes and XML
• A standard data manipulation API is provided
14. Develop WEP API with Entity Framework
6
• This tutorial uses ASP.NET Web API 2 with Entity Framework 6 to
create a web application that manipulates a back-end database.
• “Code First” approach will be demonstrated
22. Code First - Migrations Features
1. “Tools” “Library Package Manager””Package Manager Console”
2. Key in “Enable-Migrations” in “Package Manager Console”
1
2
3
23. Code First – Seeding Database
1. Modify “Configuration.cs”
2. Add below code to initialize (seeding) Database
24. Code First - Migrations Features:
Add-Migration & Update-Database
1. Key in “Add-Migration Initial” in “Package
Manager Console” and Hit “Enter”
1
2
3
3
25. Code First - Migrations Features:
Add-Migration & Update-Database
1. Key in “Update-Database” in “Package
Manager Console”
1
2
3
4
4
4
26. Explore & Test the Web API
1. Hit “F5” to run “PracticalCoding.Web”
2. Use “Fiddler2” to test below Web APIs
Demo Page
27. Code First – Migration Commands
• Commands Reference:
• http://coding.abel.nu/2012/03/ef-migrations-command-reference/#Update-
Database
• Most Frequent Used:
• Enable-Migrations: Enables Code First Migrations in a project.
• Add-Migration: Scaffolds a migration script for any pending model changes.
• Update-Database: Applies any pending migrations to the database.
• Get-Migrations: Displays the migrations that have been applied to the
target database.
28. Handling Entity Relations
• Eager Loading versus Lazy Loading
• When using EF with a relational database, it's important to understand how EF loads related
data
• Enable SQL queries that EF generates & output to Debug Trace Console
29. Use Fiddler2 to Get request
/api/books
• You can see that the Author property is null, even though the book contains a valid
AuthorId
• The “SELECT” statement takes from the Books tables, and does not reference Author
table
30. Entity Framework Data Loading
Strategy
• Very important to know how Entity Framework loading
related data
• Eager Loading
• Lazy Loading
• Explicit Loading
31. Entity Framework Data Loading
Strategy (Eager Loading)
• With eager loading, EF loads related entities as part of the initial
database query
• Copy “BooksController.cs” to “BooksEagerLoadController.cs”
• To perform eager loading, use the System.Data.Entity.Include extension
method as show below:
This tells EF to include the
Author data in the query
32. Use Fiddler2 to Get request
/api/books (Eager Load)
• The trace log shows that EF performed a join on the Book and Author tables.
33. Entity Framework Data Loading
Strategy (Lazy Loading)
• With lazy loading, EF automatically loads a related entity when the
navigation property for that entity is dereferenced.
• To enable lazy loading, make the navigation property virtual. For
example, in the Book class:
“virtual” tells EF to lazy
load the Author property
34. Entity Framework Data Loading
Strategy (Lazy Loading)
• Key in “Add-Migration AddLazyAuthorBook” in “Package Manager
Console”
• Key in “Update-Datebase” in “Package Manager Console”
1
2
3
35. Use Fiddler2 to Get request
/api/books (Lazy Load)
• When lazy loading is enabled, accessing the Author property on books[0] causes EF to
query the database for the author
• Lazy loading requires multiple database trips, because EF sends a query each time it
retrieves a related entity
36. Use Fiddler2 to Get request
/api/books (Lazy Load)
• The trace log shows that EF performed a join on the Book and Author tables.
1
2 3
4
5
6
37. Navigation Properties and Circular
References
• If there is “Circular References”, System will encounter problem
while serialize the model
38. Navigation Properties and Circular
References
• Modify “EF6DBContext” to add DbSets for CirRefBook & CirRefAuthor
• Key in “Add-Migration AddCirRefAuthorBook” in “Package Manager
Console”
• Key in “Update-Datebase” in “Package Manager Console”
• Add New WebApi Controller “CirRefBooksNGController”
40. Create Data Transfer Objects (DTOs)
• Remove circular references
• Hide particular properties that clients are not supposed to view.
• Omit some properties in order to reduce payload size.
• Flatten object graphs that contain nested objects, to make them more
convenient for clients.
• Avoid “over-posting” vulnerabilities.
• Decouple service layer from database/data storage layer.
42. Domain Entity mapping to DTO (LINQ) –
CirRefBooksLINQController.cs
POST the data via
remote WebApi using
angular $http
service object
Use LINQ to map from
Entity to DTO Object.
It works, but … just
tedious!!
45. Domain Entity mapping to DTO (AutoMapper) –
CirRefBooksController.cs
The code is much
clean and
programmer is
happy!!
The code is much
clean and easy.
The programmer is
happy again!!
48. Integration with Entity Framework
• Copy “08_AngularWithSignalR” to
“09_IntegrationWithEF6 ”
49. Modify EF Context for Dashboard
• Modify “EF6DbContext.cs” to add DbSet for “Chartdata” object
Create “DbSet” for
“Chartdata”
50. Add Entity Framework Annotation
• Modify “Models/Dashboard/Chartdata.cs” to add some EF annotation
It tell Database to
automatically generate
an Unique ID
51. Migration & Update Database
• Key in “Add-Migration AddChartdata” in “Package Manager Console”
• Key in “Update-Datebase” in “Package Manager Console”
1
2
3
54. Switch “MemDashboardRepo” to
“EF6DashboardRepo”
• Copy “SignalRDashboardController.cs” to “EF6DashboardController.cs”
Switch our Repository
from “Memory” to
“Entity Framework”
Dispose “Entity
Framework” context
object to release
database connection
55. Modify Our Angular “ChartDataFactory”
• Switch angular $http communication end point to our new WebAPI url
Before After
56. Integration with Entity Framework6
1. Select “09_Integration/index.html” and Hit “F5” to run
2. Open Multi-Browers to see charts reflect changes whenever C/U/D
operations occurred
Demo