leverage entity framework 7 in business application design

16
Leverage Entity Framework 7 in Business Application Design Notes: If you experience audio issues during the webinar, you can dial in through telephone details provided to you in your registration confirmation email. Please feel free to post questions in the questions dialog and we will try to answer as many as we can at the end. Recording of this session will be shared in next 24-48 hours. You can also write to us at [email protected] for any clarifications or information.

Upload: winwire-technologies-inc

Post on 21-Mar-2017

349 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Leverage Entity Framework 7 in Business Application Design

Leverage Entity Framework 7 in

Business Application Design Notes:

If you experience audio issues during the webinar, you can dial in through telephone details provided to you in your

registration confirmation email.

Please feel free to post questions in the questions dialog and we will try to answer as many as we can at the end.

Recording of this session will be shared in next 24-48 hours.

You can also write to us at [email protected] for any clarifications or information.

Page 2: Leverage Entity Framework 7 in Business Application Design

Session Speaker

Ankaraju Seelam

Module Lead

WinWire Technologies

Page 3: Leverage Entity Framework 7 in Business Application Design

Agenda

Querying, Modifying and Saving with EF7

EF7 Nuget Packages

Initial Release and Feature Release(s)

What’s new in Entity Framework 7

Recommend vs Not Recommend EF7

1

2

3

4

5

Modeling -- Shadow Properties

Demo

6

7

Page 4: Leverage Entity Framework 7 in Business Application Design

What is Entity Framework 7

New Platforms

New Data Stores

Page 5: Leverage Entity Framework 7 in Business Application Design

EF7 - New Platforms, New Data Stores

New Platforms

• Traditional .NET

• ASP.NET 5

• Windows 10 UAP

• Mac

• Linux

New Data Stores

• Relational & Non-Relational• Not a magic abstraction

• High level services that are useful on all/most

stores

• Non-common concerns handled by provider

extensions

• Example Providers• Relational (SQL Server, SQLite, Postgres, SQL

Compact etc.)

• Azure Table Storage

• Redis

• In Memory (for testing)

Page 6: Leverage Entity Framework 7 in Business Application Design

Initial Release and Feature Release(s)

Page 7: Leverage Entity Framework 7 in Business Application Design

EF7 Nuget Packages

Page 8: Leverage Entity Framework 7 in Business Application Design

EF7 Nuget Packages

Page 9: Leverage Entity Framework 7 in Business Application Design

EF7 Nuget Packages - Console

Page 10: Leverage Entity Framework 7 in Business Application Design

EF7 - Migrations

Page 11: Leverage Entity Framework 7 in Business Application Design

Querying, Modifying and Saving with EF7

Defining DbContext

and DbSet as always

Querying and Update

as You’ve always

done

Testing interaction

with In-Memory

provider

Batch Updates Working with

disconnected entities

More explicit

disconnected graph

behaviors

Page 12: Leverage Entity Framework 7 in Business Application Design

Querying, Modifying and Saving with EF7

Page 13: Leverage Entity Framework 7 in Business Application Design

Recommend vs Not Recommend EF7

Recommend EF7 for

• New ASP.NET 5 Applications

• Trying out new features to

provide feedback

EF7 is NOT recommend for

• Update existing applications that

use EF& or earlier

• Application with complex data

access requirements

• Applications that need O/R

features not yet implemented

• Targeting databases other than

Microsoft SQL Server

Page 14: Leverage Entity Framework 7 in Business Application Design

Shadow Properties

1) Shadow properties are properties that do not exist in your entity class.

2) The value and state of these properties is maintained purely in the Change Tracker.

3) Shadow Properties values can be obtained and changed through the “Change Tracker” API.

Shadow properties are defined in the OnModelCreating event, which is exposed as an overridable

method in DBContext. Here is an example of attaching a DateTime property called LastUpdated to the

Blog entity.

protected override void OnModelCreating(ModelBuilder modelBuilder)

{

modelBuilder.Entity<Blog>().Property<DateTime>("LastUpdated");

}

Page 15: Leverage Entity Framework 7 in Business Application Design

Demo

Page 16: Leverage Entity Framework 7 in Business Application Design

Q & A

Next Webinar

Topic : Business Transformation with Azure IoT

Suite

When: March 23rd at 9 AM PT

http://www.winwire.com/blog-winsights/

www.twitter.com/winwire

[email protected]

www.winwire.com