2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-09-13 12:43:17 +00:00
This commit is contained in:
2025-08-29 20:51:27 +03:00
parent 5b7c6a864f
commit 89d395f83f
13 changed files with 65 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

View File

@@ -15,7 +15,7 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Title>Esiur ASP.Net Middleware</Title>
@@ -25,11 +25,12 @@
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Esiur\Esiur.csproj" />
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

View File

@@ -16,7 +16,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
@@ -32,7 +32,7 @@
<ItemGroup>
<ProjectReference Include="..\Esiur\Esiur.csproj" />
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyName>Esiur.Stores.EntityCore</AssemblyName>
<Authors>Ahmed Kh. Zamil</Authors>
<Company>Esiur Foundation</Company>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Authors>Ahmed Kh. Zamil</Authors>
<Company>Esiur</Company>
<Product>Esiur MongoDB Store</Product>

View File

@@ -5,7 +5,7 @@
<Copyright>Ahmed Kh. Zamil</Copyright>
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.4.13</Version>
<Version>3.0.0</Version>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
<Authors>Ahmed Kh. Zamil</Authors>
<AssemblyVersion></AssemblyVersion>
@@ -16,15 +16,16 @@
<PackageId>Esiur</PackageId>
<Product>Esiur</Product>
<LangVersion>latest</LangVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ImplicitUsings>enable</ImplicitUsings>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<IsRoslynComponent>true</IsRoslynComponent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DefineConstants>TRACE;DEBUG;NETSTANDARD</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -43,7 +44,7 @@
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Text.Json" Version="8.0.6" GeneratePathProperty="true" />
<PackageReference Include="System.Text.Json" Version="9.0.8" GeneratePathProperty="true" />
</ItemGroup>

View File

@@ -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

View File

@@ -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;

View File

@@ -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<ResourceClassInfo> MergePartials(ImmutableArray<ResourceClassInfo> list)
@@ -294,19 +294,39 @@ $@" public partial class {ci.Name} : IResource {{
}
// === Data carriers for the pipeline ===
private readonly record struct PerClass(
ImmutableArray<string> ImportUrls,
ResourceClassInfo? ClassInfo
);
private readonly record struct PerClass {
public PerClass(ResourceClassInfo? classInfo, ImmutableArray<string> importUrls)
{
this.ImportUrls = importUrls;
this.ClassInfo = classInfo;
}
private sealed record ResourceClassInfo(
string Key,
string Name,
ClassDeclarationSyntax ClassDeclaration,
ITypeSymbol ClassSymbol,
List<IFieldSymbol> Fields,
bool HasInterface,
bool HasTrigger
);
public readonly ImmutableArray<string> ImportUrls;
public readonly ResourceClassInfo? ClassInfo;
}
private sealed record ResourceClassInfo {
public ResourceClassInfo(string key, string name ,
ClassDeclarationSyntax classDeclaration,
ITypeSymbol classSymbol, List<IFieldSymbol> 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<IFieldSymbol> Fields;
public bool HasInterface;
public bool HasTrigger;
}
}
}

View File

@@ -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

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>