本篇使用EF Code First搭建一个简易ASP.NET MVC 4网站,并允许数据库迁移. 创建一个ASP.NET MVC 4 网站. 在Models文件夹内创建Person类. public class Person { public int ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } 在Controls文件夹内创建PersonControlle…
Mac OS 安装 Redis(用于连 Redis 服务器,方便查看数据):https://redis.io/topics/quickstart wget http://download.redis.io/redis-stable.tar.gz(没有wget命令,手动下载) tar xvzf redis-stable.tar.gz cd redis-stable make sudo make install make test(测试安装是否成功) 安装好之后,我们就可以使用redis-cli命令…
Adding a controller to a ASP.NET Core MVC app with Visual Studio 在asp.net core mvc 中添加一个控制器 2017-2-28 5 分钟阅读时长 By Rick Anderson The Model-View-Controller (MVC) architectural pattern separates an app into three main components: Model, View, and Contro…
Adding a model to an ASP.NET Core MVC app在 asp.net core mvc 中添加一个model (模型)2017-3-30 8 分钟阅读时长 本文内容1. Add a data model class添加一个数据模型类2. Scaffolding a controller控制器基架3. Add EF tooling and perform initial migration添加EF工具并做基本迁移4. Test the app测试应用5. Depen…