12. C# Languange
The C# language is disarmingly simple, which makes it good for beginners, but
C# also includes all the support for the structured, component-based,
object-oriented programming that one expects of a modern language built on
the shoulders of C++ and Java.
20. Scaffolding usings Yeoman
Install the necessary yeoman generators and bower using npm.
# npm install -g yo generator-aspnet bower
Run the ASP.NET Core generator
# yo aspnet
# dotnet restore
# dotnet run
25. Connect Database
Verify that Entity Framework is installed by running
# dotnet ef - -help
Run dotnet restore again to install the new packages.
# dotnet restore
27. Generate Database
This will find our context and models, and generate a migration
# dotnet ef migrations add MyFirstMigration
create the database file and creates the tables
# dotnet ef database update
28. Use Model on Controller
[HttpGet]
[AllowAnonymous]
public IActionResult Index(string nama = null)
{
var db = new BloggingContext();
db.Blogs.Add(new Blog { Url = nama });
db.SaveChanges();
ViewData["daftarBlog"] = db.Blogs;
return View();
}