Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
43 Cards in this Set
- Front
- Back
there are three ways you can work with data in the Entity Framework Database
|
First Model First and Code First.
|
|
database first already have
|
a database tables and columns autogenerated into edmx file
|
|
Model first don't yet have
|
a database creating a model using the Entity Framework designer in Visual Studio. When the model is finished the designer can generate DDL (data definition language) statements to create the database. This approach also uses an .edmx file to store model and mapping information
|
|
Code Firsthave an existing database or not you can code your own
|
classes and properties that correspond to tables and columns and use them with the Entity Framework without an .edmx file
|
|
The data access API that was developed for Code First is based on the
|
DbContext class
|
|
POCO(Plain Old CLR Objects) they are persistence-ignorant because
|
they don't inherit from the EntityObject class
|
|
By default when you use the Database First or Model First development approaches the entity classes
|
in your data model inherit from the EntityObject class which provides them with Entity Framework functionality
|
|
the Entity Framework interprets a property that's named ___ as
|
the primary key ID or classnameID
|
|
Navigation properties hold other entities that are
|
related to this entity public virtual ICollection<Enrollment> Enrollments { get; set; }
|
|
Navigation properties are typically defined as
|
virtual so that they can take advantage of an Entity Framework function called lazy loading
|
|
If a navigation property can hold multiple entities (as in many-to-many or one-to-many relationships) its type must be
|
ICollection.
|
|
The question mark after the decimal type declaration indicates
|
public decimal? Grade { get; set; }the Grade property is nullable
|
|
The main class that coordinates Entity Framework functionality for a given data model is the
|
database context class.
|
|
You create database context classclass by deriving from
|
the System.Data.Entity.DbContext class
|
|
public class SchoolContext : DbContextcreates
|
a DbSet property for each entity set
|
|
The statement in the OnModelCreating method preventsprevents
|
table names from being pluralized. If you didnt do this the generated tables would be named Students Courses and Enrollments. Instead the table names will be Student Course and Enrollment
|
|
You dont have to create a connection string. If you don't create one
|
the Entity Framework will automatically create a SQL Server Express database for you
|
|
By default the Entity Framework looks for a connection string named
|
the same as the object context class.
|
|
The Entity Framework can automatically create (or drop and re-create)
|
a database for you when the application runs In the Application_Start method call an Entity Framework method that runs the database initializer code
|
|
Page Inspector in Visual Studio 2012 is
|
a web development tool with an integrated browser. Select any element in the integrated browser and Page Inspector instantly highlights the elements sourc
|
|
Bundling and minification are
|
two techniques you can use in ASP.NET 4.5 to improve request load time
|
|
Bundling and minification improves
|
load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript.)
|
|
Bundling is a new feature in ASP.NET 4.5 that makes
|
it easy to combine or bundle multiple files into a single file. You can create CSS JavaScript and other bundles. Fewer files means fewer HTTP requests and that can improve first page load performance.
|
|
Minification performs
|
a variety of different code optimizations to scripts or css such as removing unnecessary white space and comments and shortening variable names to one character
|
|
To enable bundling and minification
|
set the debug value to "false". You can override the Web.config setting with the EnableOptimizations property on the BundleTable class.
|
|
Bundling and minification primarily improve
|
the first page request load time.
|
|
Visual Studio 2012 introduces a simplified approach async programming
|
that leverages asynchronous support in the .NET Framework 4.5 and the Windows Runtime
|
|
In an asynchronous process
|
the application can continue with other work that doesn't depend on the web resource until the potentially blocking task finishes.
|
|
When you use asynchronous methods the application continues
|
to respond to the UI. You can resize or minimize a window for example or you can close the application if you don't want to wait for it to finish.
|
|
By using those two keywords you can use resources in the .NET Framework or the Windows Runtime to create an asynchronous method almost as easily as you create a synchronous method
|
async and await keywords in C#
|
|
App_Data folder
|
Holds the SQL Server Compact database file.
|
|
Content
|
Holds CSS files.
|
|
Controllers
|
Holds controller classes.
|
|
DAL folder
|
The data access layer. Holds the context initializer repository and unit of work classes.
|
|
Models folder
|
Holds model classes.
|
|
Properties or MyProject folder
|
Project properties.
|
|
Scripts folder
|
Script files.
|
|
ViewModels folder
|
Holds view model classes.
|
|
Views folder
|
Holds view classes.
|
|
Visual Studio project file
|
(.csproj or .vbproj).
|
|
packages.config
|
Specifies NuGet packages included in the project.
|
|
Global.asax file
|
Includes database initializer code.
|
|
Web.config file
|
Includes the connection string to the database.
|