Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1385000 create ef6 data model #10259

Merged
merged 25 commits into from Jan 14, 2019
Merged

1385000 create ef6 data model #10259

merged 25 commits into from Jan 14, 2019

Conversation

john-par
Copy link
Contributor

@john-par john-par commented Jan 7, 2019

Update for task to use .NET tutorial template.

@john-par
Copy link
Contributor Author

john-par commented Jan 9, 2019

@tdykstra this PR is ready for your review. Please let me know what you'd like changed.

@john-par
Copy link
Contributor Author

john-par commented Jan 9, 2019

@tdykstra I forgot to mention that I originally removed the add-scaffolding.png from the article and the repo. The first time I submitted the PR, I got a warning because another article in a different area of the repo was referencing the PNG. I replaced the PNG, but I did not add it back to this article.

@tdykstra
Copy link
Contributor

tdykstra commented Jan 9, 2019

@john-par Sounds good, thanks.

Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See additional comments in the DevOps task.

@@ -1,324 +1,432 @@
---
uid: mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
title: "Getting Started with Entity Framework 6 Code First using MVC 5 | Microsoft Docs"
title: "Tutorial: Create Entity Framework 6 Code First data model by using MVC 5 | Microsoft Docs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep the original title but change Getting to Get

@@ -1,324 +1,432 @@
---
uid: mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
title: "Getting Started with Entity Framework 6 Code First using MVC 5 | Microsoft Docs"
title: "Tutorial: Create Entity Framework 6 Code First data model by using MVC 5 | Microsoft Docs"
description: "In this article, you learn how to create ASP.NET MVC 5 data model applications using Entity Framework 6 and Visual Studio."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this series of tutorials, ...
... you learn how to build an ASP.NET MVC 5 application that uses Entity Framework 6 for data access.

by [Tom Dykstra](https://github.com/tdykstra)

[Download Completed Project](http://code.msdn.microsoft.com/ASPNET-MVC-Application-b01a9fe8)
# Tutorial: Create Entity Framework 6 Code First data model by using MVC 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

> * Is easier to follow.
> * Provides more EF Core best practices.
> * Provides more EF 6 Core best practices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete 6

> Please leave feedback on how you liked this tutorial and what we could improve using the comments at the bottom of the page. If you have questions that are not directly related to the tutorial, you can post them to the [ASP.NET Entity Framework forum](https://forums.asp.net/1227.aspx) or [StackOverflow.com](http://stackoverflow.com/).
>
> If you run into a problem that you can't resolve, you can generally find the solution to the problem by comparing your code to the completed project that you can download. For some common errors and how to solve them, see [Common errors, and solutions or workarounds](advanced-entity-framework-scenarios-for-an-mvc-web-application.md#errors).
In this article, you learn how to create ASP.NET MVC 5 data model applications using Entity Framework (EF) 6 and Visual Studio. This tutorial uses the Code First workflow. For information about how to choose between Code First, Database First, and Model First, see [Create a model](/ef/ef6/modeling/).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First sentence: see comment on meta description.


* [Entity Framework 6](https://www.nuget.org/packages/EntityFramework)

* [Windows Azure SDK 2.2](https://go.microsoft.com/fwlink/p/?linkid=323510) (optional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refers to an optional part of the series, and I don't think it's a separate install, I think it's a workload for VS now.


![New web app dialog box in Visual Studio](creating-an-entity-framework-data-model-for-an-asp-net-mvc-application/_static/new-web-app-dialog.png)

3. If **Authentication** is not set to **No Authentication**, change it by clicking **Change Authentication**.
> [!NOTE]
> By default, the **Authentication** option is set to **No Authentication**. For this tutorial, the web app doesn't require users to sign in. Also, it doens't restrict access based on who's signed in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo on doesn't


1. Open *Views\Shared\\_Layout.cshtml*, and make the following changes:
The code you copied into the file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original order of doing things was there for a reason -- the template code changes at times when there are updates to VS, and the original way of doing it is more likely to continue to work after a template change.


![Contoso University home page](creating-an-entity-framework-data-model-for-an-asp-net-mvc-application/_static/image6.png)
1. To run the project, press **F5**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F5 is for debug, the original instruction is to run without debugging.

```text
Install-Package EntityFramework
```
This step is one of a few steps in this tutorial that you have to do manually. You can install EF 6 automatically using the ASP.NET MVC scaffolding feature. In this tutorial, it's done manually so you can see the steps required to use EF 6. Later, you use scaffolding later to create the MVC controller and views.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rewording changes the meaning, please restore the original text.

@john-par
Copy link
Contributor Author

@tdykstra I'm sorry for the confusion. I have implemented the feedback from your comments and I reverted all changes that were not required by the User Story. Please let me know if you'd like any other changes made.

Copy link
Contributor

@tdykstra tdykstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks! Just a few nits left, let me know when its ready to merge.


> [!NOTE]
> For new development, we recommend [ASP.NET Core Razor Pages](/aspnet/core/razor-pages) over ASP.NET MVC controllers and views. For a tutorial series similar to this one using Razor Pages, see [Tutorial: Get started with Razor Pages in ASP.NET Core](/aspnet/core/tutorials/razor-pages/razor-pages-start). The new tutorial:
>
> For new development, it's recommend to use [ASP.NET Core Razor Pages](/aspnet/core/razor-pages) over ASP.NET MVC controllers and views. For a tutorial series similar to this one using Razor Pages, see [Tutorial: Get started with Razor Pages in ASP.NET Core](/aspnet/core/tutorials/razor-pages/razor-pages-start). The new tutorial:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"we recommend" in reference to an official stand is one of the instances where first-person is ok, and the style guide recommends using it rather than "it is recommended". https://worldready.cloudapp.net/Styleguide/Read?id=2700&topicid=25524

@@ -97,8 +81,6 @@ A few simple changes will set up the site menu, layout, and home page.

3. Press **Ctrl**+**F5** to run the web site. You see the home page with the main menu.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The style guide recommends no styling on key names -- i.e., Ctrl+F5 rather than Ctrl+F5 See the examples in the Select table row here.

You've seen that conventions can be overridden. For example, you specified that table names shouldn't be pluralized, and you'll see later how to explicitly mark a property as a foreign key property.
## Additional resources

For more about EF 6, see these articles:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After "see these articles" you'd expect to find a list of articles, but the bullets start "you can find...", "To learn more ..." etc. I think the list can stand alone as is without this intro line.

@john-par
Copy link
Contributor Author

@tdykstra your feedback has been incorporated. This PR is ready to be merged.

@tdykstra tdykstra merged commit c800246 into dotnet:master Jan 14, 2019
@john-par john-par deleted the 1385000-create-ef6-data-model branch January 14, 2019 16:14
@john-par john-par restored the 1385000-create-ef6-data-model branch January 14, 2019 16:16
@john-par john-par deleted the 1385000-create-ef6-data-model branch February 1, 2019 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants