mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
- 调整 移除对 System.ValueType 的依赖,减少版本冲突问题;(目前 FreeSql.dll 无任何公用库依赖)
This commit is contained in:
71
FreeSql/Internal/Model/DbToCs.cs
Normal file
71
FreeSql/Internal/Model/DbToCs.cs
Normal file
@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FreeSql.Internal.Model
|
||||
{
|
||||
public class DbToCs
|
||||
{
|
||||
public string csConvert { get; }
|
||||
public string csParse { get; }
|
||||
public string csStringify { get; }
|
||||
public string csType { get; }
|
||||
public Type csTypeInfo { get; }
|
||||
public Type csNullableTypeInfo { get; }
|
||||
public string csTypeValue { get; }
|
||||
public string dataReaderMethod { get; }
|
||||
public DbToCs(string csConvert, string csParse, string csStringify, string csType, Type csTypeInfo, Type csNullableTypeInfo, string csTypeValue, string dataReaderMethod)
|
||||
{
|
||||
this.csConvert = csConvert;
|
||||
this.csParse = csParse;
|
||||
this.csStringify = csStringify;
|
||||
this.csType = csType;
|
||||
this.csTypeInfo = csTypeInfo;
|
||||
this.csNullableTypeInfo = csNullableTypeInfo;
|
||||
this.csTypeValue = csTypeValue;
|
||||
this.dataReaderMethod = dataReaderMethod;
|
||||
}
|
||||
}
|
||||
|
||||
public static class CsToDb
|
||||
{
|
||||
public static CsToDb<T> New<T>(T type, string dbtype, string dbtypeFull, bool? isUnsigned, bool? isnullable, object defaultValue) =>
|
||||
new CsToDb<T>(type, dbtype, dbtypeFull, isUnsigned, isnullable, defaultValue);
|
||||
}
|
||||
public class CsToDb<T>
|
||||
{
|
||||
public T type { get; }
|
||||
public string dbtype { get; }
|
||||
public string dbtypeFull { get; }
|
||||
public bool? isUnsigned { get; }
|
||||
public bool? isnullable { get; }
|
||||
public object defaultValue { get; }
|
||||
public CsToDb(T type, string dbtype, string dbtypeFull, bool? isUnsigned, bool? isnullable, object defaultValue)
|
||||
{
|
||||
this.type = type;
|
||||
this.dbtype = dbtype;
|
||||
this.dbtypeFull = dbtypeFull;
|
||||
this.isUnsigned = isUnsigned;
|
||||
this.isnullable = isnullable;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DbInfoResult
|
||||
{
|
||||
public int type { get; }
|
||||
public string dbtype { get; }
|
||||
public string dbtypeFull { get; }
|
||||
public bool? isnullable { get; }
|
||||
public object defaultValue { get; }
|
||||
public DbInfoResult(int type, string dbtype, string dbtypeFull, bool? isnullable, object defaultValue)
|
||||
{
|
||||
this.type = type;
|
||||
this.dbtype = dbtype;
|
||||
this.dbtypeFull = dbtypeFull;
|
||||
this.isnullable = isnullable;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
182
FreeSql/Internal/Model/NaviteTuple.cs
Normal file
182
FreeSql/Internal/Model/NaviteTuple.cs
Normal file
@ -0,0 +1,182 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FreeSql.Internal.Model
|
||||
{
|
||||
public static class NaviteTuple
|
||||
{
|
||||
public static NaviteTuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2) => new NaviteTuple<T1, T2>(item1, item2);
|
||||
public static NaviteTuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3) => new NaviteTuple<T1, T2, T3>(item1, item2, item3);
|
||||
public static NaviteTuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4) => new NaviteTuple<T1, T2, T3, T4>(item1, item2, item3, item4);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5> Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) => new NaviteTuple<T1, T2, T3, T4, T5>(item1, item2, item3, item4, item5);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5, T6> Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) => new NaviteTuple<T1, T2, T3, T4, T5, T6>(item1, item2, item3, item4, item5, item6);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5, T6, T7> Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) => new NaviteTuple<T1, T2, T3, T4, T5, T6, T7>(item1, item2, item3, item4, item5, item6, item7);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8> Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) => new NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8>(item1, item2, item3, item4, item5, item6, item7, item8);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> Create<T1, T2, T3, T4, T5, T6, T7, T8, T9>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9) => new NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(item1, item2, item3, item4, item5, item6, item7, item8, item9);
|
||||
public static NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10) => new NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(item1, item2, item3, item4, item5, item6, item7, item8, item9, item10);
|
||||
}
|
||||
|
||||
public class NaviteTuple<T1, T2>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5, T6>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public T6 Item6 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
Item6 = item6;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5, T6, T7>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public T6 Item6 { get; }
|
||||
public T7 Item7 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
Item6 = item6;
|
||||
Item7 = item7;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public T6 Item6 { get; }
|
||||
public T7 Item7 { get; }
|
||||
public T8 Item8 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
Item6 = item6;
|
||||
Item7 = item7;
|
||||
Item8 = item8;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public T6 Item6 { get; }
|
||||
public T7 Item7 { get; }
|
||||
public T8 Item8 { get; }
|
||||
public T9 Item9 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
Item6 = item6;
|
||||
Item7 = item7;
|
||||
Item8 = item8;
|
||||
Item9 = item9;
|
||||
}
|
||||
}
|
||||
public class NaviteTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
{
|
||||
public T1 Item1 { get; }
|
||||
public T2 Item2 { get; }
|
||||
public T3 Item3 { get; }
|
||||
public T4 Item4 { get; }
|
||||
public T5 Item5 { get; }
|
||||
public T6 Item6 { get; }
|
||||
public T7 Item7 { get; }
|
||||
public T8 Item8 { get; }
|
||||
public T9 Item9 { get; }
|
||||
public T10 Item10 { get; }
|
||||
public NaviteTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8, T9 item9, T10 item10)
|
||||
{
|
||||
Item1 = item1;
|
||||
Item2 = item2;
|
||||
Item3 = item3;
|
||||
Item4 = item4;
|
||||
Item5 = item5;
|
||||
Item6 = item6;
|
||||
Item7 = item7;
|
||||
Item8 = item8;
|
||||
Item9 = item9;
|
||||
Item10 = item10;
|
||||
}
|
||||
}
|
||||
}
|
@ -18,4 +18,25 @@ namespace FreeSql.Internal.Model
|
||||
public bool IsEntity { get; set; }
|
||||
public bool IsDefaultCtor { get; set; }
|
||||
}
|
||||
public class ReadAnonymousTypeAfInfo
|
||||
{
|
||||
public ReadAnonymousTypeInfo map { get; }
|
||||
public string field { get; }
|
||||
public ReadAnonymousTypeAfInfo(ReadAnonymousTypeInfo map, string field)
|
||||
{
|
||||
this.map = map;
|
||||
this.field = field;
|
||||
}
|
||||
}
|
||||
public class ReadAnonymousTypeOtherInfo {
|
||||
public string field { get; }
|
||||
public ReadAnonymousTypeInfo read { get; }
|
||||
public List<object> retlist { get; }
|
||||
public ReadAnonymousTypeOtherInfo(string field, ReadAnonymousTypeInfo read, List<object> retlist)
|
||||
{
|
||||
this.field = field;
|
||||
this.read = read;
|
||||
this.retlist = retlist;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user