From 89d395f83f40fb7e8b16b5d15dd737f8c76e28c0 Mon Sep 17 00:00:00 2001 From: ahmed Date: Fri, 29 Aug 2025 20:51:27 +0300 Subject: [PATCH] V3 --- Esiur.ASPNet/Esiur.AspNetCore.Example.csproj | 2 +- Esiur.AspNetCore/Esiur.AspNetCore.csproj | 5 +- Esiur.CLI/Esiur.CLI.csproj | 4 +- ...ur.Examples.StandaloneWebServerDemo.csproj | 2 +- .../Esiur.Security.Cryptography.csproj | 2 +- .../Esiur.Stores.EntityCore.csproj | 2 +- .../Esiur.Stores.MongoDB.csproj | 2 +- Esiur/Esiur.csproj | 13 ++-- Esiur/LICENSE | 2 +- Esiur/Net/IIP/DistributedConnection.cs | 9 ++- Esiur/Proxy/ResourceGenerator.cs | 62 ++++++++++++------- Esiur/Proxy/ResourceProxy.cs | 2 +- Test/Test.csproj | 2 +- 13 files changed, 65 insertions(+), 44 deletions(-) diff --git a/Esiur.ASPNet/Esiur.AspNetCore.Example.csproj b/Esiur.ASPNet/Esiur.AspNetCore.Example.csproj index d5fc40f..dbd0cd9 100644 --- a/Esiur.ASPNet/Esiur.AspNetCore.Example.csproj +++ b/Esiur.ASPNet/Esiur.AspNetCore.Example.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable diff --git a/Esiur.AspNetCore/Esiur.AspNetCore.csproj b/Esiur.AspNetCore/Esiur.AspNetCore.csproj index 2825110..70ed6df 100644 --- a/Esiur.AspNetCore/Esiur.AspNetCore.csproj +++ b/Esiur.AspNetCore/Esiur.AspNetCore.csproj @@ -15,7 +15,7 @@ README.md MIT - net8.0 + net9.0 enable enable Esiur ASP.Net Middleware @@ -25,11 +25,12 @@ + - + diff --git a/Esiur.CLI/Esiur.CLI.csproj b/Esiur.CLI/Esiur.CLI.csproj index 16f9246..4ec8732 100644 --- a/Esiur.CLI/Esiur.CLI.csproj +++ b/Esiur.CLI/Esiur.CLI.csproj @@ -16,7 +16,7 @@ MIT Exe - net8.0 + net9.0 enable enable @@ -32,7 +32,7 @@ - + diff --git a/Esiur.Examples.StandaloneWebServerDemo/Esiur.Examples.StandaloneWebServerDemo.csproj b/Esiur.Examples.StandaloneWebServerDemo/Esiur.Examples.StandaloneWebServerDemo.csproj index 2da1df6..655cd1b 100644 --- a/Esiur.Examples.StandaloneWebServerDemo/Esiur.Examples.StandaloneWebServerDemo.csproj +++ b/Esiur.Examples.StandaloneWebServerDemo/Esiur.Examples.StandaloneWebServerDemo.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable diff --git a/Esiur.Security.Cryptography/Esiur.Security.Cryptography.csproj b/Esiur.Security.Cryptography/Esiur.Security.Cryptography.csproj index f4e0228..a649434 100644 --- a/Esiur.Security.Cryptography/Esiur.Security.Cryptography.csproj +++ b/Esiur.Security.Cryptography/Esiur.Security.Cryptography.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 latest diff --git a/Esiur.Stores.EntityCore/Esiur.Stores.EntityCore.csproj b/Esiur.Stores.EntityCore/Esiur.Stores.EntityCore.csproj index e0785f5..cce73d2 100644 --- a/Esiur.Stores.EntityCore/Esiur.Stores.EntityCore.csproj +++ b/Esiur.Stores.EntityCore/Esiur.Stores.EntityCore.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Esiur.Stores.EntityCore Ahmed Kh. Zamil Esiur Foundation diff --git a/Esiur.Stores.MongoDB/Esiur.Stores.MongoDB.csproj b/Esiur.Stores.MongoDB/Esiur.Stores.MongoDB.csproj index bcef8e5..b7a1d37 100644 --- a/Esiur.Stores.MongoDB/Esiur.Stores.MongoDB.csproj +++ b/Esiur.Stores.MongoDB/Esiur.Stores.MongoDB.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Ahmed Kh. Zamil Esiur Esiur MongoDB Store diff --git a/Esiur/Esiur.csproj b/Esiur/Esiur.csproj index f086228..9507c3b 100644 --- a/Esiur/Esiur.csproj +++ b/Esiur/Esiur.csproj @@ -5,7 +5,7 @@ Ahmed Kh. Zamil http://www.esiur.com true - 2.4.13 + 3.0.0 https://github.com/esiur/esiur-dotnet Ahmed Kh. Zamil @@ -16,15 +16,16 @@ Esiur Esiur latest - LICENSE - net8.0 + netstandard2.0 README.md - + enable + MIT + true True - TRACE;DEBUG;NETSTANDARD + TRACE;DEBUG @@ -43,7 +44,7 @@ - + diff --git a/Esiur/LICENSE b/Esiur/LICENSE index bc48053..e38611a 100644 --- a/Esiur/LICENSE +++ b/Esiur/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2024 Esiur Foundation, Ahmed Kh. Zamil. +Copyright (c) 2017-2025 Esiur Foundation, Ahmed Kh. Zamil. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Esiur/Net/IIP/DistributedConnection.cs b/Esiur/Net/IIP/DistributedConnection.cs index 99032f5..e5eb7c6 100644 --- a/Esiur/Net/IIP/DistributedConnection.cs +++ b/Esiur/Net/IIP/DistributedConnection.cs @@ -81,7 +81,7 @@ public partial class DistributedConnection : NetworkConnection, IStore // Fields bool invalidCredentials = false; - Timer keepAliveTimer; + System.Timers.Timer keepAliveTimer; DateTime? lastKeepAliveSent; DateTime? lastKeepAliveReceived; @@ -362,12 +362,11 @@ public partial class DistributedConnection : NetworkConnection, IStore // set local nonce session.LocalHeaders[IIPAuthPacketHeader.Nonce] = Global.GenerateBytes(32); - keepAliveTimer = new Timer(KeepAliveInterval * 1000); - keepAliveTimer.Elapsed += KeepAliveTimer_Elapsed; + keepAliveTimer = new System.Timers.Timer(KeepAliveInterval * 1000); + keepAliveTimer.Elapsed += KeepAliveTimer_Elapsed; ; } - - private void KeepAliveTimer_Elapsed(object sender, ElapsedEventArgs e) + private void KeepAliveTimer_Elapsed(object? sender, ElapsedEventArgs e) { if (!IsConnected) return; diff --git a/Esiur/Proxy/ResourceGenerator.cs b/Esiur/Proxy/ResourceGenerator.cs index b532bf0..621106e 100644 --- a/Esiur/Proxy/ResourceGenerator.cs +++ b/Esiur/Proxy/ResourceGenerator.cs @@ -174,17 +174,17 @@ $@" public partial class {ci.Name} : IResource {{ classInfo = new ResourceClassInfo ( - Key: key, - Name: cls.Name, - ClassDeclaration: cds, - ClassSymbol: cls, - Fields: exportedFields, - HasInterface: hasInterface, - HasTrigger: hasTrigger + key, + cls.Name, + cds, + cls, + exportedFields, + hasInterface, + hasTrigger ); } - return new PerClass(importUrls, classInfo); + return new PerClass(classInfo, importUrls); } private static ImmutableArray MergePartials(ImmutableArray list) @@ -294,19 +294,39 @@ $@" public partial class {ci.Name} : IResource {{ } // === Data carriers for the pipeline === - private readonly record struct PerClass( - ImmutableArray ImportUrls, - ResourceClassInfo? ClassInfo - ); + private readonly record struct PerClass { + public PerClass(ResourceClassInfo? classInfo, ImmutableArray importUrls) + { + this.ImportUrls = importUrls; + this.ClassInfo = classInfo; + } - private sealed record ResourceClassInfo( - string Key, - string Name, - ClassDeclarationSyntax ClassDeclaration, - ITypeSymbol ClassSymbol, - List Fields, - bool HasInterface, - bool HasTrigger - ); + public readonly ImmutableArray ImportUrls; + public readonly ResourceClassInfo? ClassInfo; + } + + private sealed record ResourceClassInfo { + + public ResourceClassInfo(string key, string name , + ClassDeclarationSyntax classDeclaration, + ITypeSymbol classSymbol, List fileds, bool hasInterface, bool hasTrigger) + { + Key = key; + Name = name; + ClassDeclaration = classDeclaration; + ClassSymbol = classSymbol; + Fields = fileds; + HasInterface = hasInterface; + HasTrigger = hasTrigger; + } + + public string Key; + public string Name; + public ClassDeclarationSyntax ClassDeclaration; + public ITypeSymbol ClassSymbol; + public List Fields; + public bool HasInterface; + public bool HasTrigger; + } } } \ No newline at end of file diff --git a/Esiur/Proxy/ResourceProxy.cs b/Esiur/Proxy/ResourceProxy.cs index 3fce124..5f48330 100644 --- a/Esiur/Proxy/ResourceProxy.cs +++ b/Esiur/Proxy/ResourceProxy.cs @@ -82,7 +82,7 @@ public static class ResourceProxy var props = from p in type.GetProperties() where p.CanWrite && p.GetSetMethod().IsVirtual && - p.GetCustomAttributes(typeof(ResourceProperty), false).Count() > 0 + p.GetCustomAttributes(typeof(ExportAttribute), false).Count() > 0 select p; #endif diff --git a/Test/Test.csproj b/Test/Test.csproj index 9cb0db4..35619dd 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0