• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

efcore: EF Core is a modern object-database mapper for .NET.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

efcore

开源软件地址:

https://gitee.com/github_mirrors/efcore

开源软件介绍:

Repository

build status test results

This repository is home to the following .NET Foundation projects. These projects are maintained by Microsoft and licensed under the Apache License, Version 2.0.

Entity Framework Core

latest version preview version downloads

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations. EF Core works with SQL Server, Azure SQL Database, SQLite, Azure Cosmos DB, MySQL, PostgreSQL, and other databases through a provider plugin API.

Installation

EF Core is available on NuGet. Install the provider package corresponding to your target database. See the list of providers in the docs for additional databases.

dotnet add package Microsoft.EntityFrameworkCore.SqlServerdotnet add package Microsoft.EntityFrameworkCore.Sqlitedotnet add package Microsoft.EntityFrameworkCore.Cosmos

Use the --version option to specify a preview version to install.

Use the daily builds to verify bug fixes and provide early feedback.

Usage

The following code demonstrates basic usage of EF Core. For a full tutorial configuring the DbContext, defining the model, and creating the database, see getting started in the docs.

using (var db = new BloggingContext()){    // Inserting data into the database    db.Add(new Blog { Url = "http://blogs.msdn.com/adonet" });    db.SaveChanges();    // Querying    var blog = db.Blogs        .OrderBy(b => b.BlogId)        .First();    // Updating    blog.Url = "https://devblogs.microsoft.com/dotnet";    blog.Posts.Add(        new Post        {            Title = "Hello World",            Content = "I wrote an app using EF Core!"        });    db.SaveChanges();    // Deleting    db.Remove(blog);    db.SaveChanges();}

Microsoft.Data.Sqlite

latest version preview version downloads

Microsoft.Data.Sqlite is a lightweight ADO.NET provider for SQLite. The EF Core provider for SQLite is built on top of this library. However, it can also be used independently or with other data access libraries.

Installation

The latest stable version is available on NuGet.

dotnet add package Microsoft.Data.Sqlite

Use the --version option to specify a preview version to install.

Use the daily builds to verify bug fixes and provide early feedback.

Usage

This library implements the common ADO.NET abstractions for connections, commands, data readers, and so on. For more information, see Microsoft.Data.Sqlite on Microsoft Docs.

using (var connection = new SqliteConnection("Data Source=Blogs.db")){    connection.Open();    var command = connection.CreateCommand();    command.CommandText = "SELECT Url FROM Blogs";    using (var reader = command.ExecuteReader())    {        while (reader.Read())        {            var url = reader.GetString(0);        }    }}

Getting support

If you have a specific question about using these projects, we encourage you to ask it on Stack Overflow. If you encounter a bug or would like to request a feature, submit an issue. For more details, see getting support.

Contributing

If you're interested in contributing to these projects, see contributing.

See also


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Apteryx.MongoDB.Driver.Extend: 针对MongoDB.Driver的扩展发布时间:2022-03-24
下一篇:
lazy-cat: 全自动orm映射及api自动映射发布时间:2022-03-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap