b4822711d91483ced8911dd2b95c3fcd4761965a
Guides/MVC-Integration/Phase-II-Draft.md
| ... | ... | @@ -85,10 +85,23 @@ namespace Sample_MVCApp.Models { |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | ``` |
| 88 | +**c.** Right click on Models folder -> Add -> New Item -> Choose class. Name it UserContext.cs ->Add |
|
| 89 | +**d.** Copy and paste below code in UserContext.cs |
|
| 88 | 90 | |
| 91 | +```csharp |
|
| 92 | +using System; |
|
| 93 | +using System.Collections.Generic; |
|
| 94 | +using System.Data.Entity; |
|
| 95 | +using System.Linq; |
|
| 96 | +using System.Web; |
|
| 89 | 97 | |
| 98 | +namespace Sample_MVCApp.Models { |
|
| 99 | + public class UserContext : DbContext { |
|
| 100 | + public DbSet<User> Users { get; set; } |
|
| 101 | + } |
|
| 102 | +} |
|
| 90 | 103 | |
| 91 | - |
|
| 104 | +``` |
|
| 92 | 105 | ### Step 5. Add Controller |
| 93 | 106 | |
| 94 | 107 | ### Step 6. Add Views |