mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
配置 xmlDoc
This commit is contained in:
parent
b05c4f6e90
commit
d49be984bd
@ -96,7 +96,6 @@ namespace FreeSql.Tests {
|
||||
//testddd.Persistent().Wait();
|
||||
g.sqlite.GetRepository<TestEntity, int>().Insert(testddd);
|
||||
|
||||
|
||||
var testpid1 = g.mysql.Insert<TestTypeInfo>().AppendData(new TestTypeInfo { Name = "Name" + DateTime.Now.ToString("yyyyMMddHHmmss") }).ExecuteIdentity();
|
||||
g.mysql.Insert<TestInfo>().AppendData(new TestInfo { Title = "Title" + DateTime.Now.ToString("yyyyMMddHHmmss"), CreateTime = DateTime.Now, TypeGuid = (int)testpid1 }).ExecuteAffrows();
|
||||
|
||||
|
@ -37,6 +37,7 @@ namespace FreeSql.DataAnnotations {
|
||||
_column.IsPrimary = value;
|
||||
return this;
|
||||
}
|
||||
/// <summary>
|
||||
/// 自增标识
|
||||
/// </summary>
|
||||
public ColumnFluent IsIdentity(bool value) {
|
||||
|
@ -9,19 +9,20 @@ using System.Text;
|
||||
namespace FreeSql.Extensions.EntityUtil {
|
||||
public static class EntityUtilExtensions {
|
||||
|
||||
static MethodInfo MethodStringBuilderAppend = typeof(StringBuilder).GetMethod("Append", new Type[] { typeof(object) });
|
||||
static MethodInfo MethodStringBuilderToString = typeof(StringBuilder).GetMethod("ToString", new Type[0]);
|
||||
static PropertyInfo MethodStringBuilderLength = typeof(StringBuilder).GetProperty("Length");
|
||||
static MethodInfo MethodStringConcat = typeof(string).GetMethod("Concat", new Type[] { typeof(object) });
|
||||
static MethodInfo MethodFreeUtilNewMongodbId = typeof(FreeUtil).GetMethod("NewMongodbId");
|
||||
static readonly MethodInfo MethodStringBuilderAppend = typeof(StringBuilder).GetMethod("Append", new Type[] { typeof(object) });
|
||||
static readonly MethodInfo MethodStringBuilderToString = typeof(StringBuilder).GetMethod("ToString", new Type[0]);
|
||||
static readonly PropertyInfo MethodStringBuilderLength = typeof(StringBuilder).GetProperty("Length");
|
||||
static readonly MethodInfo MethodStringConcat = typeof(string).GetMethod("Concat", new Type[] { typeof(object) });
|
||||
static readonly MethodInfo MethodFreeUtilNewMongodbId = typeof(FreeUtil).GetMethod("NewMongodbId");
|
||||
|
||||
static ConcurrentDictionary<DataType, ConcurrentDictionary<Type, Func<object, string>>> _dicGetEntityKeyString = new ConcurrentDictionary<DataType, ConcurrentDictionary<Type, Func<object, string>>>();
|
||||
/// <summary>
|
||||
/// 获取实体的主键值,以 "*|_,[,_|*" 分割,当任意一个主键属性无值时(当Guid无值时,会生成有序的新值),返回 null
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="_table"></param>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="splitString"></param>
|
||||
/// <returns></returns>
|
||||
//public static string GetEntityKeyString<TEntity>(this IFreeSql orm, TEntity entity, string splitString = "*|_,[,_|*") => GetEntityKeyString(orm, typeof(TEntity), entity, splitString);
|
||||
public static string GetEntityKeyString(this IFreeSql orm, Type entityType, object entity, string splitString = "*|_,[,_|*") {
|
||||
@ -126,8 +127,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 获取实体的主键值,多个主键返回数组
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="_table"></param>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
//public static object[] GetEntityKeyValues<TEntity>(this IFreeSql orm, TEntity entity) => GetEntityKeyValues(orm, typeof(TEntity), entity);
|
||||
@ -165,9 +166,10 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 获取实体的属性值
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="_table"></param>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="propertyName"></param>
|
||||
/// <returns></returns>
|
||||
//public static object GetEntityValueWithPropertyName<TEntity>(this IFreeSql orm, TEntity entity, string propertyName) => GetEntityKeyValues(orm, typeof(TEntity), entity, propertyName);
|
||||
public static object GetEntityValueWithPropertyName(this IFreeSql orm, Type entityType, object entity, string propertyName) {
|
||||
@ -202,8 +204,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 获取实体的所有数据,以 (1, 2, xxx) 的形式
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="_table"></param>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
//public static string GetEntityString<TEntity>(this IFreeSql orm, TEntity entity) => GetEntityString(orm, typeof(TEntity), entity);
|
||||
@ -321,8 +323,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 设置实体中主键内的自增字段值(若存在)
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="idtval"></param>
|
||||
//public static void SetEntityIdentityValueWithPrimary<TEntity>(this IFreeSql orm, TEntity entity, long idtval) => SetEntityIdentityValueWithPrimary(orm, typeof(TEntity), entity, idtval);
|
||||
@ -355,8 +357,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 获取实体中主键内的自增字段值(若存在)
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
//public static long GetEntityIdentityValueWithPrimary<TEntity>(this IFreeSql orm, TEntity entity) => GetEntityIdentityValueWithPrimary(orm, typeof(TEntity), entity);
|
||||
public static long GetEntityIdentityValueWithPrimary(this IFreeSql orm, Type entityType, object entity) {
|
||||
@ -402,8 +404,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 清除实体的主键值,将自增、Guid类型的主键值清除
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
//public static void ClearEntityPrimaryValueWithIdentityAndGuid<TEntity>(this IFreeSql orm, TEntity entity) => ClearEntityPrimaryValueWithIdentityAndGuid(orm, typeof(TEntity), entity);
|
||||
public static void ClearEntityPrimaryValueWithIdentityAndGuid(this IFreeSql orm, Type entityType, object entity) {
|
||||
@ -446,8 +448,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 清除实体的主键值,将自增、Guid类型的主键值清除
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
//public static void ClearEntityPrimaryValueWithIdentity<TEntity>(this IFreeSql orm, TEntity entity) => ClearEntityPrimaryValueWithIdentity(orm, typeof(TEntity), entity);
|
||||
public static void ClearEntityPrimaryValueWithIdentity(this IFreeSql orm, Type entityType, object entity) {
|
||||
@ -480,10 +482,11 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 对比两个实体值,返回相同/或不相同的列名
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity1"></param>
|
||||
/// <param name="entity2"></param>
|
||||
/// <param name="isEqual"></param>
|
||||
/// <returns></returns>
|
||||
//public static string[] CompareEntityValueReturnColumns<TEntity>(this IFreeSql orm, TEntity entity1, TEntity entity2, bool isEqual) => CompareEntityValueReturnColumns(orm, typeof(TEntity), entity1, entity2, isEqual);
|
||||
public static string[] CompareEntityValueReturnColumns(this IFreeSql orm, Type entityType, object entity1, object entity2, bool isEqual) {
|
||||
@ -534,11 +537,11 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 设置实体中某属性的数值增加指定的值
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="propertyName"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="incrBy"></param>
|
||||
//public static void SetEntityIncrByWithPropertyName<TEntity>(this IFreeSql orm, TEntity entity, string propertyName, int incrBy) => SetEntityIncrByWithPropertyName(orm, typeof(TEntity), entity, propertyName, incrBy);
|
||||
public static void SetEntityIncrByWithPropertyName(this IFreeSql orm, Type entityType, object entity, string propertyName, int incrBy) {
|
||||
if (entity == null) return;
|
||||
@ -576,8 +579,8 @@ namespace FreeSql.Extensions.EntityUtil {
|
||||
/// <summary>
|
||||
/// 设置实体中某属性的值
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="orm"></param>
|
||||
/// <param name="entityType"></param>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="propertyName"></param>
|
||||
/// <param name="value"></param>
|
||||
|
@ -76,7 +76,7 @@ public static class FreeSqlGlobalExtensions {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将 IEnumable<T> 转成 ISelect<T>,以便使用 FreeSql 的查询功能。此方法用于 Lambad 表达式中,快速进行集合导航的查询。
|
||||
/// 将 IEnumable<T> 转成 ISelect<T>,以便使用 FreeSql 的查询功能。此方法用于 Lambad 表达式中,快速进行集合导航的查询。
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity"></typeparam>
|
||||
/// <param name="that"></param>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>0.5.6</Version>
|
||||
<Version>0.5.7</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Authors>YeXiangQin</Authors>
|
||||
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>
|
||||
@ -21,6 +21,11 @@
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>C:\Users\28810\Desktop\github\FreeSql\FreeSql\FreeSql.xml</DocumentationFile>
|
||||
<WarningLevel>3</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CS-Script.Core" Version="1.0.6" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
||||
|
2431
FreeSql/FreeSql.xml
Normal file
2431
FreeSql/FreeSql.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 指定事务对象
|
||||
/// </summary>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="connection"></param>
|
||||
/// <returns></returns>
|
||||
IDelete<T1> WithConnection(DbConnection connection);
|
||||
|
||||
@ -63,7 +63,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 设置表名规则,可用于分库/分表,参数1:默认表名;返回值:新表名;
|
||||
/// </summary>
|
||||
/// <param name="dataTable"></param>
|
||||
/// <param name="tableRule"></param>
|
||||
/// <returns></returns>
|
||||
IDelete<T1> AsTable(Func<string, string> tableRule);
|
||||
/// <summary>
|
||||
|
@ -16,7 +16,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 指定事务对象
|
||||
/// </summary>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="connection"></param>
|
||||
/// <returns></returns>
|
||||
IInsert<T1> WithConnection(DbConnection connection);
|
||||
|
||||
@ -61,7 +61,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 设置表名规则,可用于分库/分表,参数1:默认表名;返回值:新表名;
|
||||
/// </summary>
|
||||
/// <param name="dataTable"></param>
|
||||
/// <param name="tableRule"></param>
|
||||
/// <returns></returns>
|
||||
IInsert<T1> AsTable(Func<string, string> tableRule);
|
||||
/// <summary>
|
||||
|
@ -25,7 +25,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 审核或跟踪 ToList 即将返回的数据
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
/// <param name="action"></param>
|
||||
/// <returns></returns>
|
||||
TSelect TrackToList(Action<object> action);
|
||||
|
||||
@ -68,7 +68,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 设置表名规则,可用于分库/分表,参数1:实体类型;参数2:默认表名;返回值:新表名;
|
||||
/// </summary>
|
||||
/// <param name="dataTable"></param>
|
||||
/// <param name="tableRule"></param>
|
||||
/// <returns></returns>
|
||||
TSelect AsTable(Func<Type, string, string> tableRule);
|
||||
/// <summary>
|
||||
|
@ -269,7 +269,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 按选择的列分组,GroupBy(a => a.Name) | GroupBy(a => new{a.Name,a.Time})
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="exp"></param>
|
||||
/// <returns></returns>
|
||||
ISelectGrouping<TKey, T1> GroupBy<TKey>(Expression<Func<T1, TKey>> exp);
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 指定事务对象
|
||||
/// </summary>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="connection"></param>
|
||||
/// <returns></returns>
|
||||
IUpdate<T1> WithConnection(DbConnection connection);
|
||||
|
||||
@ -76,7 +76,7 @@ namespace FreeSql {
|
||||
/// 设置列的的新值为基础上增加,格式:Set(a => a.Clicks + 1) 相当于 clicks=clicks+1
|
||||
/// </summary>
|
||||
/// <typeparam name="TMember"></typeparam>
|
||||
/// <param name="column"></param>
|
||||
/// <param name="binaryExpression"></param>
|
||||
/// <returns></returns>
|
||||
IUpdate<T1> Set<TMember>(Expression<Func<T1, TMember>> binaryExpression);
|
||||
/// <summary>
|
||||
@ -130,7 +130,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 设置表名规则,可用于分库/分表,参数1:默认表名;返回值:新表名;
|
||||
/// </summary>
|
||||
/// <param name="dataTable"></param>
|
||||
/// <param name="tableRule"></param>
|
||||
/// <returns></returns>
|
||||
IUpdate<T1> AsTable(Func<string, string> tableRule);
|
||||
/// <summary>
|
||||
|
@ -162,7 +162,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age", new SqlParameter { ParameterName = "age", Value = 25 })
|
||||
/// </summary>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="cmdType"></param>
|
||||
/// <param name="cmdText"></param>
|
||||
/// <param name="cmdParms"></param>
|
||||
@ -173,7 +173,7 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 执行SQL返回对象集合,Query<User>("select * from user where age > @age", new { age = 25 })
|
||||
/// </summary>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="cmdText"></param>
|
||||
/// <param name="parms"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -31,7 +31,6 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 循环或批量获取缓存数据
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
string Get(string key);
|
||||
@ -47,8 +46,6 @@ namespace FreeSql {
|
||||
/// <param name="key">缓存键</param>
|
||||
/// <param name="timeoutSeconds">缓存秒数</param>
|
||||
/// <param name="getData">获取源数据的函数</param>
|
||||
/// <param name="serialize">序列化函数</param>
|
||||
/// <param name="deserialize">反序列化函数</param>
|
||||
/// <returns></returns>
|
||||
T Shell<T>(string key, int timeoutSeconds, Func<T> getData);
|
||||
/// <summary>
|
||||
@ -59,8 +56,6 @@ namespace FreeSql {
|
||||
/// <param name="field">字段</param>
|
||||
/// <param name="timeoutSeconds">缓存秒数</param>
|
||||
/// <param name="getData">获取源数据的函数</param>
|
||||
/// <param name="serialize">序列化函数</param>
|
||||
/// <param name="deserialize">反序列化函数</param>
|
||||
/// <returns></returns>
|
||||
T Shell<T>(string key, string field, int timeoutSeconds, Func<T> getData);
|
||||
|
||||
@ -82,7 +77,6 @@ namespace FreeSql {
|
||||
/// <summary>
|
||||
/// 循环或批量获取缓存数据
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetAsync(string key);
|
||||
@ -97,9 +91,7 @@ namespace FreeSql {
|
||||
/// <typeparam name="T">缓存类型</typeparam>
|
||||
/// <param name="key">缓存键</param>
|
||||
/// <param name="timeoutSeconds">缓存秒数</param>
|
||||
/// <param name="getData">获取源数据的函数</param>
|
||||
/// <param name="serialize">序列化函数</param>
|
||||
/// <param name="deserialize">反序列化函数</param>
|
||||
/// <param name="getDataAsync">获取源数据的函数</param>
|
||||
/// <returns></returns>
|
||||
Task<T> ShellAsync<T>(string key, int timeoutSeconds, Func<Task<T>> getDataAsync);
|
||||
/// <summary>
|
||||
@ -109,9 +101,7 @@ namespace FreeSql {
|
||||
/// <param name="key">缓存键</param>
|
||||
/// <param name="field">字段</param>
|
||||
/// <param name="timeoutSeconds">缓存秒数</param>
|
||||
/// <param name="getData">获取源数据的函数</param>
|
||||
/// <param name="serialize">序列化函数</param>
|
||||
/// <param name="deserialize">反序列化函数</param>
|
||||
/// <param name="getDataAsync">获取源数据的函数</param>
|
||||
/// <returns></returns>
|
||||
Task<T> ShellAsync<T>(string key, string field, int timeoutSeconds, Func<Task<T>> getDataAsync);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public static partial class PostgreSQLTypesExtensions {
|
||||
/// <summary>
|
||||
/// 将 1010101010 这样的二进制字符串转换成 BitArray
|
||||
/// </summary>
|
||||
/// <param name="_1010">1010101010</param>
|
||||
/// <param name="_1010Str">1010101010</param>
|
||||
/// <returns></returns>
|
||||
public static BitArray ToBitArray(this string _1010Str) {
|
||||
if (_1010Str == null) return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user