PM> &"../tools/cli.ps1"
// -----------------------------------------------------------------------------
// ______ _______ _
// | ____| |__ __| | |
// | |__ _ _ _ __ | | ___ ___ | |___
// | __| | | | '__| | |/ _ \ / _ \| / __|
// | | | |_| | | | | (_) | (_) | \__ \
// |_| \__,_|_| |_|\___/ \___/|_|___/
//
// -----------------------------------------------------------------------------
// 让 .NET 开发更简单,更通用,更流行。
// Copyright © 2020 Furion, Baiqian Co.,Ltd.
//
// 框架名称:Furion
// 框架作者:百小僧
// 框架版本:1.0.0
// 源码地址:https://gitee.com/monksoul/Furion
// 开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)
// -----------------------------------------------------------------------------
Furion Tools v1.0.0 启动中......
Furion Tools v1.0.0 启动成功!
Furion Tools v1.0.0 请键入操作类型:[G] 界面操作,[任意字符] 命令行操作
Furion Tools v1.0.0 您的输入是: G
Furion Tools v1.0.0 正在加载数据库表和视图......
Furion Tools v1.0.0 加载成功!
Furion Tools v1.0.0 正在编译解决方案代码......
Build started...
Build succeeded.
For foreign key FK_PersonDetail_Person_PersonId on table dbo.PersonDetail, unable to model the end of the foreign key on principal table dbo.Person. This is usually because the principal table was not included in the selection set.
Furion Tools v1.0.0 编译成功!
Furion Tools v1.0.0 开始生成实体文件......
Furion Tools v1.0.0 正在生成 City.cs 实体代码......
Furion Tools v1.0.0 成功生成 City.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public partial class City : IEntity, IEntityTypeBuilder<City>
{
public City()
{
InverseParent = new HashSet<City>();
}
public int Id { get; set; }
public string Name { get; set; }
public int? ParentId { get; set; }
public DateTime CreatedTime { get; set; }
public DateTime? UpdatedTime { get; set; }
public bool IsDeleted { get; set; }
public virtual City Parent { get; set; }
public virtual ICollection<City> InverseParent { get; set; }
public void Configure(EntityTypeBuilder<City> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasIndex(e => e.ParentId, "IX_City_ParentId");
entityBuilder.HasOne(d => d.Parent)
.WithMany(p => p.InverseParent)
.HasForeignKey(d => d.ParentId);
}
}
}
Furion Tools v1.0.0 正在生成 PersonDetail.cs 实体代码......
Furion Tools v1.0.0 成功生成 PersonDetail.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public partial class PersonDetail : IEntity, IEntityTypeBuilder<PersonDetail>
{
public int Id { get; set; }
public string PhoneNumber { get; set; }
public string Qq { get; set; }
public int PersonId { get; set; }
public void Configure(EntityTypeBuilder<PersonDetail> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasIndex(e => e.PersonId, "IX_PersonDetail_PersonId")
.IsUnique();
entityBuilder.Property(e => e.Qq).HasColumnName("QQ");
}
}
}
Furion Tools v1.0.0 正在生成 Post.cs 实体代码......
Furion Tools v1.0.0 成功生成 Post.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public partial class Post : IEntity
{
public int Id { get; set; }
public string Name { get; set; }
public DateTime CreatedTime { get; set; }
public DateTime? UpdatedTime { get; set; }
public bool IsDeleted { get; set; }
}
}
Furion Tools v1.0.0 正在生成 VPerson.cs 实体代码......
Furion Tools v1.0.0 成功生成 VPerson.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public partial class VPerson : IEntity, IEntityTypeBuilder<VPerson>
{
public int Id { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public string Address { get; set; }
public void Configure(EntityTypeBuilder<VPerson> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasNoKey();
entityBuilder.ToView("V_Person");
entityBuilder.Property(e => e.Id).ValueGeneratedOnAdd();
entityBuilder.Property(e => e.Name).HasMaxLength(32);
}
}
}
Furion Tools v1.0.0 全部实体生成成功!
PM>