using System; using System.Collections.Generic; using System.Linq.Expressions; using FreeSql; using FreeSql.DataAnnotations; using FreeSql.Extensions.EfCoreFluentApi; using FreeSql.Internal.CommonProvider; partial class FreeSqlDbContextExtensions { /// /// EFCore 95% 相似的 FluentApi 扩展方法 /// /// /// /// /// public static ICodeFirst Entity(this ICodeFirst codeFirst, Action> modelBuilder) { var cf = codeFirst as CodeFirstProvider; codeFirst.ConfigEntity(tf => modelBuilder(new EfCoreTableFluent(cf._orm, tf))); return codeFirst; } /// /// EFCore 95% 相似的 FluentApi 扩展方法 /// /// /// 实体类型 /// /// public static ICodeFirst Entity(this ICodeFirst codeFirst, Type entityType, Action modelBuilder) { var cf = codeFirst as CodeFirstProvider; codeFirst.ConfigEntity(entityType, tf => modelBuilder(new EfCoreTableFluent(cf._orm, tf, entityType))); return codeFirst; } }