Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools

DbContext

public class WebCrawlerDbContext : DbContext
{
public DbSet<TableName> YourTable { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(@"Server=; Database=DbName; User ID=sa; Password=;");
}
}

迁移

add-migration xxx
update-database

使用

using (var context = new WebCrawlerDbContext())
{
//do something
context.SaveChanges();
}

查询相关内容:加载相关数据

参考资料

Getting Started With Entity Framework Core - Console

Entity Framework Core for Console的更多相关文章

  1. 创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表

    创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表 创建数据模型类(POCO类) 在Models文件夹下添 ...

  2. Working with Data » Getting started with ASP.NET Core and Entity Framework Core using Visual Studio »迁移

    Migrations¶ 4 of 4 people found this helpful The Contoso University sample web application demonstra ...

  3. Professional C# 6 and .NET Core 1.0 - 38 Entity Framework Core

    本文内容为转载,重新排版以供学习研究.如有侵权,请联系作者删除. 转载请注明本文出处:Professional C# 6 and .NET Core 1.0 - 38 Entity Framework ...

  4. 在Apworks数据服务中使用基于Entity Framework Core的仓储(Repository)实现

    <在ASP.NET Core中使用Apworks快速开发数据服务>一文中,我介绍了如何使用Apworks框架的数据服务来快速构建用于查询和管理数据模型的RESTful API,通过该文的介 ...

  5. Entity Framework Core 命名约定

    本文翻译自<Entity Framework Core: Naming Convention>,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 注意:我使用的是 Entity ...

  6. Entity Framework Core 2.0 使用入门

    一.前言 Entity Framework(后面简称EF)作为微软家的ORM,自然而然从.NET Framework延续到了.NET Core.以前我也嫌弃EF太重而不去使用它,但是EF Core(E ...

  7. Entity Framework Core 2.0 使用代码进行自动迁移

    一.前言 我们在使用EF进行开发的时候,肯定会遇到将迁移更新到生产数据库这个问题,前面写了一篇文章介绍了Entity Framework Core 2.0的入门使用,这里面介绍了使用命令生成迁移所需的 ...

  8. ABP 教程文档 1-1 手把手引进门之 ASP.NET Core & Entity Framework Core(官方教程翻译版 版本3.2.5)

    本文是ABP官方文档翻译版,翻译基于 3.2.5 版本 官方文档分四部分 一. 教程文档 二.ABP 框架 三.zero 模块 四.其他(中文翻译资源) 本篇是第一部分的第一篇. 第一部分分三篇 1- ...

  9. UWP: 在 UWP 中使用 Entity Framework Core 操作 SQLite 数据库

    在应用中使用 SQLite 数据库来存储数据是相当常见的.在 UWP 平台中要使用 SQLite,一般会使用 SQLite for Universal Windows Platform 和 SQLit ...

随机推荐

  1. Spring Cloud Sleuth 知识点

    Spring应用在监测到Java依赖包中有sleuth和zipkin后,会自动在RestTemplate的调用过程中向HTTP请求注入追踪信息,并向Zipkin Server发送这些信息. 出处:ht ...

  2. 前端重定向,index.html文件被浏览器缓存,导致整个应用都是旧的

    解决方法:https://github.com/ant-design/ant-design-pro/issues/1365#issuecomment-384496088

  3. SSM之JSON通用返回格式

    /** * 通用的返回的类 * */ public class Result { //状态码 100-成功 200-失败 private int code; //提示信息 private String ...

  4. Big Data Landscape 2018

    https://mattturck.com/bigdata2018/

  5. jsp request对象

    getParameter( ) :返回name指定参数的参数值 String[]  getParameterValues(String name)    :返回包含参数name的所有值的数值 getA ...

  6. 树上背包DP Luogu P2014 选课

    #include <cstdio> #include <cctype> #include <cstring> #include <algorithm> ...

  7. mac 使用tesseract识别图片中的中文

    安装 tesseractbrew install tesseract 加入环境变量export TESSDATA_PREFIX=/usr/local/Cellar/tesseract/4.1.0/sh ...

  8. 「BJOI2018」治疗之雨

    传送门 Description 有\(m+1\)个数,第一个数为\(p\),每轮:选一个数\(+1\),再依次选\(k\)个数\(-1\) 要求如果第一个数\(=N\),不能选它\(+1\),如果第一 ...

  9. Android Studio 之 ViewModel

    ViewModel 是 JetPack 类库中的一个功能,可以保存控件的状态 ,在整个Activity 生命周期中,状态不会失效 如屏幕翻转时,状态可保留,不会失效! 与 LiveData 配合使用! ...

  10. IntelliJ IDEA 2019从入门到癫狂 图文教程!

    阅读本文大概需要 6 分钟. 作者:yizhiwazi 来源:www.jianshu.com/p/9c65b7613c30 前言:IntelliJ IDEA 如果说IntelliJ IDEA是一款现代 ...