Newcats.DataAccess.Core 1.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Newcats.DataAccess.Core --version 1.0.4
NuGet\Install-Package Newcats.DataAccess.Core -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Newcats.DataAccess.Core" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Newcats.DataAccess.Core --version 1.0.4
#r "nuget: Newcats.DataAccess.Core, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Newcats.DataAccess.Core as a Cake Addin
#addin nuget:?package=Newcats.DataAccess.Core&version=1.0.4

// Install Newcats.DataAccess.Core as a Cake Tool
#tool nuget:?package=Newcats.DataAccess.Core&version=1.0.4

数据库交互实体类及相关特性使用说明

  • 1.数据库实体类以Entity结尾
  • 2.使用相关特性,对实体类属性进行设置
  • TableAttribute:数据库表名,多表连接时为对应的连接关系
  • KeyAttribute:数据库主键标识
  • DatabaseGeneratedAttribute:数据库生成特性,标识自增、计算列等(插入时会忽略此字段)
  • NotMappedAttribute:数据库中不存在此字段时,使用此特性忽略该字段
  • ColumnAttribute:实体类别名映射特性,标注数据库实际字段名

默认约定

  • 1.若不使用特性,则程序按默认约定进行解析
  • 2.表名称为类名,或者类名去掉Entity字符串
  • 3.主键为Id字段,或者Id结尾的字段
  • 4.推荐使用特性进行设置
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

[Table("User")]
public class UserEntity
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }

    public string Name { get; set; }

    public string AddressId { get; set; }

    [NotMapped]
    public string Phone { get; set; }
}

[Table("Address")]
public class AddressEntity
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public int Id { get; set; }

    public string Name { get; set; }
}

[Table(" User a left join Address b on a.AddressId=b.Id ")]
public class UserDto
{
    [Column("a.Id")]
    public int Id { get; set; }

    [Column("a.Name")]
    public string Name { get; set; }

    [Column("b.Name")]
    public string Address { get; set; }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Newcats.DataAccess.Core:

Package Downloads
Newcats.DataAccess.MySql

Some easy methods for Insert/Delete/Update/Query/InsertBulk/SqlBulkCopy without sql based on Dapper and pure entity class (no attributes needs). Support ReadWriteSplit (multiple read database) with default policy like WeightedRoundRobin/Random/RoundRobin, also provide interface of customize policy. Check detail from github for how to use.

Newcats.DataAccess.SqlServer

Some easy methods for Insert/Delete/Update/Query/InsertBulk/SqlBulkCopy without sql based on Dapper and pure entity class (no attributes needs). Support ReadWriteSplit (multiple read database) with default policy like WeightedRoundRobin/Random/RoundRobin, also provide interface of customize policy. Check detail from github for how to use.

Newcats.DataAccess.PostgreSql

Some easy methods for Insert/Delete/Update/Query/InsertBulk/SqlBulkCopy without sql based on Dapper and pure entity class (no attributes needs). Support ReadWriteSplit (multiple read database) with default policy like WeightedRoundRobin/Random/RoundRobin, also provide interface of customize policy. Check detail from github for how to use.

Newcats.DataAccess.Sqlite

Some easy methods for Insert/Delete/Update/Query/InsertBulk/SqlBulkCopy without sql based on Dapper and pure entity class (no attributes needs). Support ReadWriteSplit (multiple read database) with default policy like WeightedRoundRobin/Random/RoundRobin, also provide interface of customize policy. Check detail from github for how to use.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 1,505 1/22/2022
1.2.6 1,015 1/9/2022
1.2.5 980 12/28/2021
1.2.3 926 12/26/2021
1.2.2 909 12/26/2021
1.2.0 1,015 12/19/2021
1.1.9 860 12/12/2021
1.1.8 836 12/12/2021
1.1.7 941 12/9/2021
1.1.6 838 12/9/2021
1.1.5 3,535 11/25/2021
1.1.3 870 11/18/2021
1.1.2 833 11/18/2021
1.1.1 939 11/18/2021
1.1.0 807 11/18/2021
1.0.14 929 11/18/2021
1.0.13 861 11/17/2021
1.0.12 859 11/17/2021
1.0.11 819 11/17/2021
1.0.10 984 10/26/2021
1.0.9 976 10/25/2021
1.0.8 929 10/25/2021
1.0.7 896 10/25/2021
1.0.6 916 10/20/2021
1.0.5 847 10/20/2021
1.0.4 933 10/20/2021
1.0.3 931 10/20/2021
1.0.2 864 10/20/2021
1.0.1 835 10/19/2021
1.0.0 834 10/19/2021