Skip to content

Commit a73a6ab

Browse files
committed
- 优化 GetPropertiesDictIgnoreCase 不返回没有 get 的属性;
1 parent 6fcee2b commit a73a6ab

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

Examples/base_entity/Program.cs

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Densen.Models.ids;
1+
using Confluent.Kafka;
2+
using Densen.Models.ids;
23
using FreeSql;
34
using FreeSql.DataAnnotations;
45
using FreeSql.Extensions;
@@ -566,8 +567,8 @@ static void Main(string[] args)
566567
////.UseConnectionString(FreeSql.DataType.PostgreSQL, "Host=192.168.164.10;Port=5432;Username=postgres;Password=123456;Database=toc;Pooling=true;Maximum Pool Size=2")
567568
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToLower)
568569

569-
//.UseConnectionString(FreeSql.DataType.Oracle, "user=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
570-
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
570+
.UseConnectionString(FreeSql.DataType.Oracle, "user id=user1;password=123456;data source=//127.0.0.1:1521/XE;Pooling=true;Max Pool Size=2")
571+
.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
571572

572573
//.UseConnectionString(FreeSql.DataType.Dameng, "server=127.0.0.1;port=5236;user=2user;password=123456789;database=2user;poolsize=5;")
573574
//.UseNameConvert(FreeSql.Internal.NameConvertType.ToUpper)
@@ -599,6 +600,18 @@ static void Main(string[] args)
599600
BaseEntity.Initialization(fsql, () => _asyncUow.Value);
600601
#endregion
601602

603+
var lstKafka = fsql.Ado.Query<ProducerModel_Kafka>("SELECT 123 AS ID,'10.0.0.0' AS IP FROM dual ");
604+
605+
606+
607+
608+
609+
610+
611+
var subsql01 = fsql.Select<User1>().Where(a =>
612+
fsql.Select<UserGroup>().Where(b => b.Id == a.GroupId).Max(b => b.CreateTime) > DateTime.Now)
613+
.ToSql();
614+
602615
var cccsql1 = fsql.Select<CCC>().Page(1, 10).ToSql();
603616
var cccsql2 = fsql.Select<CCC>().Page(2, 10).ToSql();
604617

@@ -2525,4 +2538,24 @@ class pgjson_copy001
25252538
public Guid id { get; set; }
25262539
public JObject json { get; set; }
25272540
}
2541+
public class ProducerModel_Kafka
2542+
{
2543+
/// <summary>
2544+
/// 这个可以
2545+
/// </summary>
2546+
public IProducer<string, string> Sender { get; set; }
2547+
/// <summary>
2548+
/// ID
2549+
/// </summary>
2550+
public long ID { get; set; }
2551+
/// <summary>
2552+
/// IP
2553+
/// </summary>
2554+
public string IP { get; set; }
2555+
2556+
/// <summary>
2557+
/// 这个不行
2558+
/// </summary>
2559+
public ProducerConfig PConfig { get; set; }
2560+
}
25282561
}

Examples/base_entity/base_entity.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16+
<PackageReference Include="Confluent.Kafka" Version="2.2.0" />
1617
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1718
<PackageReference Include="Npgsql.NetTopologySuite" Version="6.0.4" />
1819
<PackageReference Include="MessagePack" Version="2.4.35" />

Examples/base_entity/base_entity.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeSql.DbContext/FreeSql.DbContext.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeSql/Extensions/FreeSqlGlobalExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ public static Dictionary<string, PropertyInfo> GetPropertiesDictIgnoreCase(this
208208
if (existsProp.DeclaringType != prop.DeclaringType) dict[prop.Name] = prop;
209209
continue;
210210
}
211+
if (prop.GetGetMethod() == null) continue;
211212
dict.Add(prop.Name, prop);
212213
}
213214
return dict;

0 commit comments

Comments
 (0)