ITnmg.EntityFrameworkCore.Extensions 1.0.4

EntityFrameworkCore 的扩展,通过反射注册实体模型。

Install-Package ITnmg.EntityFrameworkCore.Extensions -Version 1.0.4
dotnet add package ITnmg.EntityFrameworkCore.Extensions --version 1.0.4
<PackageReference Include="ITnmg.EntityFrameworkCore.Extensions" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ITnmg.EntityFrameworkCore.Extensions --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ITnmg.EntityFrameworkCore.Extensions

EntityFrameworkCore 的扩展,通过反射注册实体模型。

Install

Run the following command in the Package Manager Console.
在 nuget 包管理器控制台输入以下命令

PM> Install-Package ITnmg.EntityFrameworkCore.Extensions

Getting Started

public class Order : IEntityTypeConfiguration<Order>
{
    public string Id { get; set; }

    public void Configure( EntityTypeBuilder<Order> builder )
    {
        base.Configure( builder );
        builder.Property( m => m.Id ).HasMaxLength( 255 ).IsRequired();
    }
}

public class EFContext : DbContext
{
    public EFContext( DbContextOptions options ) : base( options )
    {
    }

    protected override void OnModelCreating( ModelBuilder modelBuilder )
    {
        base.OnModelCreating( modelBuilder );
        modelBuilder.ApplyConfigurationFromAssembly( Assembly.GetExecutingAssembly() );
    }
}

ITnmg.EntityFrameworkCore.Extensions

EntityFrameworkCore 的扩展,通过反射注册实体模型。

Install

Run the following command in the Package Manager Console.
在 nuget 包管理器控制台输入以下命令

PM> Install-Package ITnmg.EntityFrameworkCore.Extensions

Getting Started

public class Order : IEntityTypeConfiguration<Order>
{
    public string Id { get; set; }

    public void Configure( EntityTypeBuilder<Order> builder )
    {
        base.Configure( builder );
        builder.Property( m => m.Id ).HasMaxLength( 255 ).IsRequired();
    }
}

public class EFContext : DbContext
{
    public EFContext( DbContextOptions options ) : base( options )
    {
    }

    protected override void OnModelCreating( ModelBuilder modelBuilder )
    {
        base.OnModelCreating( modelBuilder );
        modelBuilder.ApplyConfigurationFromAssembly( Assembly.GetExecutingAssembly() );
    }
}

Release Notes

update nuget parkages

Version History

Version Downloads Last updated
1.0.4 92 12/13/2018
1.0.3 113 9/12/2018
1.0.2 109 9/11/2018
1.0.1 102 9/10/2018
1.0.0 199 6/21/2018