To Download Slides - Charleston Alt Dot Net

yrekazzyzxamuckInternet και Εφαρμογές Web

4 Δεκ 2013 (πριν από 3 χρόνια και 8 μήνες)

64 εμφανίσεις

Charleston
Alt.Net
Entity Framework Code First
Tonights
Sponsers
Upcoming Events

CodeShow

March 14
th
2013….

http://www.chscodeshow.com
/

Covering Mongo, Node
Js
, and Angular
Js

A few tickets left… $249.00 students $49.00

2013
iFiveK
April 18
th
at 6:30 P.M.

http://www.ifivek.com/

Hackathon
August
-
2013

at
Sparc
… Stay tuned for dates…
start planning now.

Need Microsoft Teams…. 1 team last year…. We want at least 5+ this year.
Darren McDowell

B.S. in I.S. Johnson and Wales University

M.B.A. Kennesaw State University

Director Of Software Development

Social Strategy1

Email: Darrenmcd@yahoo.com

Twitter:@
DarrenMcDowell

Been coding since 1990…. Concentrating on Microsoft Technologies

Today concentrating on
ASP.Net
MVC, JavaScript, C#, and
Sql
Server,
Playing around with Mongo, Azure,
Node.Js
.

For Fun… Love spending time with the
Mrs
, and my 3 year old…
Nfl
(go
pats),Baseball (Go Sox),Sailing, Fishing, Beach, Blackbeard's, Monkey
Joes, and the Aquarium.
Social Strategy1

Media Monitoring Firm.. Started in 2010… 15 Employees..

www.socialstrategy1.com

Twitter: @SocialStrategy1

Email: Info@SocialStrategy1.com

Two Products

Engage

Specializing in High End Engagements, Large customers, with lots of
mentions across many media spectrums, such as Facebook and Twitter

Beam

Small business media engagement and monitoring tool.
History of Data in
.Net

First came the
recordsets
and datasets….
Ohh
ahh
it was better then
what we were doing in vb6 and classic asp……

Then came
Linq
To
Sql
…. Model driven…. Again
ohh
ahh
… problem
was I could only use it on
sql
server…..

Then came Entity Framework…. Very powerful, could be used on
mysql
,
sql
,
sql
lite, oracle…. Model Driven… Very Complex…

No we have Entity Framework Code First

Ef
power without the
confusing model.
Entity Framework Code First

Came out in Entity Framework 4.1…

Entity Framework Models uses an
edmx
file to create your model

Takes xml files and forms entity classes in memory at runtime….

Entity Framework Code First

Takes
Poco
classes and based on data annotations or a fluent
api
to creates
entity classes in memory at run time.

Smaller amount of overhead, because you do not have the big bloated xml
model to deal with.
Architecture

Model

Simple
Poco

Data Layer/Repository

Contains your context……

Application

Calls your data layer… displays your model
Lets get coding
Data Annotations

A Few Examples

[Key]

primary key

[
MaxLength
(20)]

[
MinLength
(20)]

[Required]

If a validation error exists based on the data annotation like
MaxLength
,
MinLength
and required…
.Net
will raise a
EntityValidationError
exception.
EntityValidationErrors

Has a field called
ValidationErrors
which will have 1
-
many errors

So 1
EntityValidationErrors
may have many
validationerror
fields

If it like asp.net web forms or MVC front end validation… that’s
because it is…. These errors will flow from the back end to the front
end automatically for
ya
.
Other cool features.

DropCreateDatabaseIfModelChanges

Will automatically drop and recreate the database if the model changes….. Be
careful with this one…
Sources

To Find out more information

Lecture relied heavily on the following documentation

Pluralsight

Entity Framework 4.1 Code First
Julie
Lerman

Other websites to learn more

The
Gu
-
Scott Guthrie (
Code
-
First Development with Entity Framework 4
)

http://
weblogs.asp.net/scottgu/archive/2010/07/16/code
-
first
-
development
-
with
-
entity
-
framework
-
4.aspx
Next Meeting

May 2
nd
2013

Presenter: Andrew Whitaker

People Matter

Topic:
TypeScript

http://www.typescriptlang.org/
TypeScript
is a language for application
-
scale JavaScript development.
TypeScript
is a typed superset of JavaScript that compiles to plain JavaScript.
Any browser. Any host. Any OS. Open Source.

Location:
Sparc