mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-09 09:50:54 +08:00
- 增加 IsSyncStructureToUpper 参数,以便适应 Oracle 大小写使用习惯; - FreeSql.Repository 增加 GuidRepository 类,适用 Insert 方法无须返回插入的数据; - FreeSql.Repository 增加 IFreeSql 扩展方法 GetRepository、GetGuidRepository;
78 lines
2.4 KiB
C#
78 lines
2.4 KiB
C#
using FreeSql.DataAnnotations;
|
||
using System;
|
||
|
||
namespace FreeSql {
|
||
public interface ICodeFirst {
|
||
|
||
/// <summary>
|
||
/// 【开发环境必备】自动同步实体结构到数据库,程序运行中检查实体表是否存在,然后创建或修改
|
||
/// </summary>
|
||
bool IsAutoSyncStructure { get; set; }
|
||
|
||
/// <summary>
|
||
/// 转小写同步结构
|
||
/// </summary>
|
||
bool IsSyncStructureToLower { get; set; }
|
||
/// <summary>
|
||
/// 转大写同步结构
|
||
/// </summary>
|
||
bool IsSyncStructureToUpper { get; set; }
|
||
/// <summary>
|
||
/// 延时加载导航属性对象,导航属性需要声明 virtual
|
||
/// </summary>
|
||
bool IsLazyLoading { get; set; }
|
||
|
||
/// <summary>
|
||
/// 将实体类型与数据库对比,返回DDL语句
|
||
/// </summary>
|
||
/// <typeparam name="TEntity"></typeparam>
|
||
/// <returns></returns>
|
||
string GetComparisonDDLStatements<TEntity>();
|
||
/// <summary>
|
||
/// 将实体类型集合与数据库对比,返回DDL语句
|
||
/// </summary>
|
||
/// <param name="entityTypes"></param>
|
||
/// <returns></returns>
|
||
string GetComparisonDDLStatements(params Type[] entityTypes);
|
||
/// <summary>
|
||
/// 同步实体类型到数据库
|
||
/// </summary>
|
||
/// <typeparam name="TEntity"></typeparam>
|
||
/// <returns></returns>
|
||
bool SyncStructure<TEntity>();
|
||
/// <summary>
|
||
/// 同步实体类型集合到数据库
|
||
/// </summary>
|
||
/// <param name="entityTypes"></param>
|
||
/// <returns></returns>
|
||
bool SyncStructure(params Type[] entityTypes);
|
||
|
||
/// <summary>
|
||
/// 根据 System.Type 获取数据库信息
|
||
/// </summary>
|
||
/// <param name="type"></param>
|
||
/// <returns></returns>
|
||
(int type, string dbtype, string dbtypeFull, bool? isnullable, object defaultValue)? GetDbInfo(Type type);
|
||
/// <summary>
|
||
/// 在外部配置实体的特性
|
||
/// </summary>
|
||
/// <typeparam name="T"></typeparam>
|
||
/// <param name="entity"></param>
|
||
/// <returns></returns>
|
||
ICodeFirst ConfigEntity<T>(Action<TableFluent<T>> entity);
|
||
/// <summary>
|
||
/// 在外部配置实体的特性
|
||
/// </summary>
|
||
/// <param name="type"></param>
|
||
/// <param name="entity"></param>
|
||
/// <returns></returns>
|
||
ICodeFirst ConfigEntity(Type type, Action<TableFluent> entity);
|
||
/// <summary>
|
||
/// 获取在外部配置实体的特性
|
||
/// </summary>
|
||
/// <param name="type"></param>
|
||
/// <returns>未使用ConfigEntity配置时,返回null</returns>
|
||
TableAttribute GetConfigEntity(Type type);
|
||
}
|
||
}
|