mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-07 12:02:59 +00:00
.Net 6 Upgrade
This commit is contained in:
parent
1166e93ba9
commit
530df018ec
@ -32,8 +32,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
|
||||
public class EntityResource : IResource
|
||||
{
|
||||
@ -72,4 +71,3 @@ namespace Esiur.Stores.EntityCore
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -34,8 +34,7 @@ using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
public class EntityStore : IStore
|
||||
{
|
||||
public Instance Instance { get; set; }
|
||||
@ -239,4 +238,3 @@ namespace Esiur.Stores.EntityCore
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
|
||||
struct EntityTypeInfo
|
||||
{
|
||||
public string Name;
|
||||
@ -14,4 +14,3 @@ namespace Esiur.Stores.EntityCore
|
||||
public PropertyInfo PrimaryKey;
|
||||
// public Func<DbContext> Getter;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>Esiur.Stores.EntityCore</AssemblyName>
|
||||
<Authors>Ahmed Kh. Zamil</Authors>
|
||||
<Company>Esiur Foundation</Company>
|
||||
@ -10,6 +10,7 @@
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageId>Esiur.Stores.EntityCore</PackageId>
|
||||
<Version>1.2.5</Version>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -21,7 +22,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
|
||||
<PackageReference Include="System.Collections" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -36,8 +36,8 @@ using System.Reflection;
|
||||
using Esiur.Proxy;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
|
||||
public class EsiurExtensionOptions : IDbContextOptionsExtension
|
||||
{
|
||||
|
||||
@ -102,13 +102,17 @@ namespace Esiur.Stores.EntityCore
|
||||
|
||||
public override string LogFragment => "Esiur";
|
||||
|
||||
public override long GetServiceProviderHashCode() => 2312;
|
||||
public override int GetServiceProviderHashCode() => 2312;
|
||||
|
||||
public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
|
||||
public static class EsiurExtensions
|
||||
{
|
||||
//public static T CreateResource<T>(this DbContext dbContext, object properties = null) where T:class,IResource
|
||||
@ -198,4 +198,3 @@ namespace Esiur.Stores.EntityCore
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
public class EsiurPlugin : IConventionSetPlugin
|
||||
{
|
||||
private readonly IDbContextOptions _options;
|
||||
@ -57,4 +56,3 @@ namespace Esiur.Stores.EntityCore
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Stores.EntityCore
|
||||
{
|
||||
namespace Esiur.Stores.EntityCore;
|
||||
|
||||
public class EsiurProxyRewrite : IModelFinalizingConvention
|
||||
{
|
||||
private static readonly MethodInfo _createInstance
|
||||
@ -48,23 +48,11 @@ namespace Esiur.Stores.EntityCore
|
||||
|
||||
private readonly ConstructorBindingConvention _directBindingConvention;
|
||||
|
||||
//public static object CreateInstance(IDbContextOptions dbContextOptions, IEntityType entityType,
|
||||
// object[] constructorArguments, DbContext context, long id)
|
||||
//{
|
||||
// return CreateInstance(dbContextOptions, entityType,
|
||||
// constructorArguments, context, id);
|
||||
//}
|
||||
|
||||
public static object CreateInstance(
|
||||
IDbContextOptions dbContextOptions,
|
||||
|
||||
public static object CreateInstance(IDbContextOptions dbContextOptions,
|
||||
IEntityType entityType,
|
||||
//object id
|
||||
object[] properties
|
||||
|
||||
// ILazyLoader loader,
|
||||
// object[] constructorArguments,
|
||||
//DbContext context,
|
||||
)
|
||||
object[] properties)
|
||||
{
|
||||
var id = properties.First();
|
||||
|
||||
@ -116,15 +104,16 @@ namespace Esiur.Stores.EntityCore
|
||||
// var ann = entityType.GetAnnotation(CoreAnnotationNames.ConstructorBinding);
|
||||
|
||||
#pragma warning disable EF1001 // Internal EF Core API usage.
|
||||
var binding = (InstantiationBinding)entityType[CoreAnnotationNames.ConstructorBinding];
|
||||
var binding = ((EntityType)entityType).ConstructorBinding;// (InstantiationBinding)entityType[CoreAnnotationNames.ConstructorBinding];
|
||||
#pragma warning restore EF1001 // Internal EF Core API usage.
|
||||
if (binding == null)
|
||||
{
|
||||
_directBindingConvention.ProcessModelFinalizing(modelBuilder, context);
|
||||
|
||||
#pragma warning disable EF1001 // Internal EF Core API usage.
|
||||
binding = (InstantiationBinding)entityType[CoreAnnotationNames.ConstructorBinding];
|
||||
binding = ((EntityType)entityType).ConstructorBinding; // (InstantiationBinding)entityType[CoreAnnotationNames.ConstructorBinding];
|
||||
#pragma warning restore EF1001 // Internal EF Core API usage.
|
||||
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@ -133,31 +122,43 @@ namespace Esiur.Stores.EntityCore
|
||||
if (key == null)
|
||||
continue;
|
||||
|
||||
//var keys = entityType.FindPrimaryKey().Properties.Select(x=>new PropertyParameterBinding(x));
|
||||
|
||||
entityType.SetAnnotation(
|
||||
#pragma warning disable EF1001 // Internal EF Core API usage.
|
||||
CoreAnnotationNames.ConstructorBinding,
|
||||
#pragma warning restore EF1001 // Internal EF Core API usage.
|
||||
new FactoryMethodBinding(
|
||||
_createInstance,
|
||||
new List<ParameterBinding>
|
||||
((EntityType)entityType).SetConstructorBinding(
|
||||
UpdateConstructorBindings(key, proxyType),
|
||||
ConfigurationSource.Convention);
|
||||
|
||||
binding = ((EntityType)entityType).ServiceOnlyConstructorBinding;
|
||||
if (binding != null)
|
||||
{
|
||||
new DependencyInjectionParameterBinding(typeof(IDbContextOptions), typeof(IDbContextOptions)),
|
||||
new EntityTypeParameterBinding(),
|
||||
//new PropertyParameterBinding(key)
|
||||
// constructor arguments
|
||||
//new ObjectArrayParameterBinding(binding.ParameterBindings),
|
||||
//new ContextParameterBinding(typeof(DbContext)),
|
||||
//new ObjectArrayParameterBinding(entityType.FindPrimaryKey().Properties.Select(x=>new PropertyParameterBinding(x)).ToArray())
|
||||
new ObjectArrayParameterBinding(new ParameterBinding[]{
|
||||
new PropertyParameterBinding(key) })
|
||||
//})
|
||||
// new Microsoft.EntityFrameworkCore.Metadata.ObjectArrayParameterBinding(),
|
||||
//new ObjectArrayParameterBinding()
|
||||
((EntityType)entityType).SetServiceOnlyConstructorBinding(
|
||||
UpdateConstructorBindings(key, proxyType),
|
||||
ConfigurationSource.Convention);
|
||||
}
|
||||
|
||||
},
|
||||
proxyType));
|
||||
|
||||
// entityType.SetAnnotation(
|
||||
//#pragma warning disable EF1001 // Internal EF Core API usage.
|
||||
// CoreAnnotationNames.ConstructorBinding,
|
||||
//#pragma warning restore EF1001 // Internal EF Core API usage.
|
||||
// new FactoryMethodBinding(
|
||||
// _createInstance,
|
||||
// new List<ParameterBinding>
|
||||
// {
|
||||
// new DependencyInjectionParameterBinding(typeof(IDbContextOptions), typeof(IDbContextOptions)),
|
||||
// new EntityTypeParameterBinding(),
|
||||
// //new PropertyParameterBinding(key)
|
||||
// // constructor arguments
|
||||
// //new ObjectArrayParameterBinding(binding.ParameterBindings),
|
||||
// //new ContextParameterBinding(typeof(DbContext)),
|
||||
// //new ObjectArrayParameterBinding(entityType.FindPrimaryKey().Properties.Select(x=>new PropertyParameterBinding(x)).ToArray())
|
||||
// new ObjectArrayParameterBinding(new ParameterBinding[]{
|
||||
// new PropertyParameterBinding(key) })
|
||||
// //})
|
||||
// // new Microsoft.EntityFrameworkCore.Metadata.ObjectArrayParameterBinding(),
|
||||
// //new ObjectArrayParameterBinding()
|
||||
|
||||
// },
|
||||
// proxyType));
|
||||
|
||||
}
|
||||
catch
|
||||
@ -165,9 +166,30 @@ namespace Esiur.Stores.EntityCore
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private InstantiationBinding UpdateConstructorBindings(
|
||||
IConventionProperty key,
|
||||
Type proxyType)
|
||||
{
|
||||
return new FactoryMethodBinding(
|
||||
_createInstance,
|
||||
new List<ParameterBinding>
|
||||
{
|
||||
new DependencyInjectionParameterBinding(typeof(IDbContextOptions), typeof(IDbContextOptions)),
|
||||
new EntityTypeParameterBinding(),
|
||||
new ObjectArrayParameterBinding(new ParameterBinding[]{
|
||||
new PropertyParameterBinding((IProperty)key) })
|
||||
|
||||
},
|
||||
proxyType);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Version>1.5.2</Version>
|
||||
<PackageId>Esiur.Stores.MongoDB</PackageId>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -37,8 +37,8 @@ using System.Linq;
|
||||
using Esiur.Security.Permissions;
|
||||
using Esiur.Proxy;
|
||||
|
||||
namespace Esiur.Stores.MongoDB
|
||||
{
|
||||
namespace Esiur.Stores.MongoDB;
|
||||
|
||||
public class MongoDBStore : IStore
|
||||
{
|
||||
public Instance Instance { get; set; }
|
||||
@ -271,7 +271,7 @@ namespace Esiur.Stores.MongoDB
|
||||
else
|
||||
{
|
||||
|
||||
return new AsyncReply<object>(value.RawValue);
|
||||
return new AsyncReply<object>(BsonTypeMapper.MapToDotNetValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
@ -917,4 +917,3 @@ namespace Esiur.Stores.MongoDB
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncAwaiter : INotifyCompletion
|
||||
{
|
||||
Action callback = null;
|
||||
@ -50,4 +50,3 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncAwaiter<T> : INotifyCompletion
|
||||
{
|
||||
Action callback = null;
|
||||
@ -49,5 +49,3 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncBag : AsyncReply
|
||||
{
|
||||
|
||||
@ -128,4 +128,3 @@ namespace Esiur.Core
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncBagAwaiter : INotifyCompletion
|
||||
{
|
||||
Action callback = null;
|
||||
@ -49,5 +49,3 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncBagAwaiter<T> : INotifyCompletion
|
||||
{
|
||||
Action callback = null;
|
||||
@ -49,5 +49,3 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncBag<T> : AsyncBag
|
||||
{
|
||||
public AsyncBag<T> Then(Action<T[]> callback)
|
||||
@ -72,4 +72,3 @@ namespace Esiur.Core
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncException : Exception
|
||||
{
|
||||
public readonly ErrorType Type;
|
||||
@ -54,4 +54,3 @@ namespace Esiur.Core
|
||||
return Code.ToString() + ": " + Message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncQueue<T> : AsyncReply<T>
|
||||
{
|
||||
List<AsyncReply<T>> list = new List<AsyncReply<T>>();
|
||||
@ -81,4 +81,3 @@ namespace Esiur.Core
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ using System.Threading;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
[AsyncMethodBuilder(typeof(AsyncReplyBuilder))]
|
||||
public class AsyncReply
|
||||
{
|
||||
@ -356,5 +356,4 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncReplyBuilder
|
||||
{
|
||||
AsyncReply reply;
|
||||
@ -65,4 +65,3 @@ namespace Esiur.Core
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncReplyBuilder<T>
|
||||
{
|
||||
AsyncReply<T> reply;
|
||||
@ -58,10 +58,10 @@ namespace Esiur.Core
|
||||
|
||||
public AsyncReply<T> Task
|
||||
{
|
||||
get {
|
||||
get
|
||||
{
|
||||
return reply;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ using System.Threading;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
[AsyncMethodBuilder(typeof(AsyncReplyBuilder<>))]
|
||||
public class AsyncReply<T> : AsyncReply
|
||||
{
|
||||
@ -375,5 +375,4 @@ namespace Esiur.Core
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,8 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public class AsyncReply
|
||||
{
|
||||
|
||||
@ -182,4 +182,3 @@ namespace Esiur.Core
|
||||
this.result = result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public enum ErrorType
|
||||
{
|
||||
Management,
|
||||
Exception
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public enum ExceptionCode : ushort
|
||||
{
|
||||
HostNotReachable,
|
||||
@ -42,4 +42,3 @@ namespace Esiur.Core
|
||||
AlreadyUnlistened,
|
||||
NotListenable
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public enum ExceptionLevel
|
||||
{
|
||||
Code = 0x1,
|
||||
@ -11,4 +11,3 @@ namespace Esiur.Core
|
||||
Source = 0x4,
|
||||
Trace = 0x8
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public interface IAsyncReply<out T>//IAsyncEnumerator<T>
|
||||
{
|
||||
IAsyncReply<T> Then(Action<T> callback);
|
||||
@ -18,4 +18,3 @@ namespace Esiur.Core
|
||||
|
||||
T Wait();
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public delegate void DestroyedEvent(object sender);
|
||||
|
||||
public interface IDestructible
|
||||
@ -36,4 +36,3 @@ namespace Esiur.Core
|
||||
event DestroyedEvent OnDestroy;
|
||||
void Destroy();
|
||||
}
|
||||
}
|
||||
|
@ -29,12 +29,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public enum LogType
|
||||
{
|
||||
Debug,
|
||||
Warning,
|
||||
Error,
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Core
|
||||
{
|
||||
namespace Esiur.Core;
|
||||
|
||||
public enum ProgressType
|
||||
{
|
||||
Execution,
|
||||
Network,
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ using System.Collections;
|
||||
using Esiur.Core;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public class AutoList<T, ST> : IEnumerable<T>, ICollection, ICollection<T>
|
||||
{
|
||||
|
||||
@ -311,4 +311,3 @@ namespace Esiur.Data
|
||||
// return Remove(item);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ using Esiur.Misc;
|
||||
using System.Reflection;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
/// <summary>
|
||||
/// BinaryList holds a list of items to be converted to binary for storage and transmission
|
||||
/// </summary>
|
||||
@ -711,4 +711,3 @@ namespace Esiur.Data
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Collections;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public static class Codec
|
||||
{
|
||||
/// <summary>
|
||||
@ -415,7 +415,8 @@ namespace Esiur.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
connection.GetTemplate((Guid)classId).Then(tmp => {
|
||||
connection.GetTemplate((Guid)classId).Then(tmp =>
|
||||
{
|
||||
ParseVarArray(data, offset, length, connection).Then(ar =>
|
||||
{
|
||||
var record = new Record();
|
||||
@ -1610,4 +1611,3 @@ namespace Esiur.Data
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ using Esiur.Data;
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public static class DC // Data Converter
|
||||
{
|
||||
public static object CastConvert(object value, Type destinationType)
|
||||
@ -988,4 +988,3 @@ namespace Esiur.Data
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -28,8 +28,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
public enum DataType : byte
|
||||
{
|
||||
Void = 0x0,
|
||||
@ -116,4 +115,3 @@ namespace Esiur.Data
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public interface IRecord
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
public interface IUserType
|
||||
{
|
||||
object Get();
|
||||
void Set(object value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,7 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public class KeyList<KT, T> : IEnumerable<KeyValuePair<KT, T>>
|
||||
{
|
||||
@ -241,4 +240,3 @@ namespace Esiur.Data
|
||||
dic = new Dictionary<KT, T>();
|
||||
}
|
||||
}
|
||||
}
|
@ -28,10 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
public class NotModified
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public class PropertyValue
|
||||
{
|
||||
/// <summary>
|
||||
@ -32,4 +32,3 @@ namespace Esiur.Data
|
||||
Date = date;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
public class Record : KeyList<string, object>, IRecord
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public enum RecordComparisonResult : byte
|
||||
{
|
||||
Null,
|
||||
@ -11,4 +11,3 @@ namespace Esiur.Data
|
||||
RecordSameType,
|
||||
Same
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public enum ResourceArrayType
|
||||
{
|
||||
Dynamic = 0x0,
|
||||
Static = 0x10,
|
||||
Wrapper = 0x20,
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public enum ResourceComparisonResult
|
||||
{
|
||||
Null, // null
|
||||
@ -11,4 +11,3 @@ namespace Esiur.Data
|
||||
Local, // resource is local
|
||||
Same, // Same as previous
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Esiur.Net.IIP;
|
||||
using Esiur.Resource;
|
||||
|
||||
/*
|
||||
|
||||
Copyright (c) 2017-2021 Ahmed Kh. Zamil
|
||||
@ -24,14 +23,16 @@ SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
using Esiur.Net.IIP;
|
||||
using Esiur.Resource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
class ResourceJsonConverter : JsonConverter<IResource>
|
||||
{
|
||||
public override IResource Read(
|
||||
@ -96,4 +97,3 @@ namespace Esiur.Data
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ using System.Collections;
|
||||
using Esiur.Core;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public class ResourceList<T, ST> : IEnumerable<T>, ICollection, ICollection<T>
|
||||
{
|
||||
|
||||
@ -271,4 +271,3 @@ namespace Esiur.Data
|
||||
return list.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,8 @@ using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
|
||||
public class StringKeyList : IEnumerable<KeyValuePair<string, string>>
|
||||
{
|
||||
@ -217,4 +217,3 @@ namespace Esiur.Data
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
@ -34,8 +34,8 @@ using Esiur.Core;
|
||||
using System.Reflection;
|
||||
using System.Dynamic;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public class Structure : IEnumerable<KeyValuePair<string, object>>
|
||||
{
|
||||
|
||||
@ -178,4 +178,3 @@ namespace Esiur.Data
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Data
|
||||
{
|
||||
namespace Esiur.Data;
|
||||
|
||||
public enum StructureComparisonResult : byte
|
||||
{
|
||||
Null,
|
||||
@ -12,4 +12,3 @@ namespace Esiur.Data
|
||||
StructureSameTypes,
|
||||
Same
|
||||
}
|
||||
}
|
||||
|
@ -4,20 +4,20 @@
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Description>Distributed Resources Platform</Description>
|
||||
<Copyright>Ahmed Kh. Zamil</Copyright>
|
||||
<PackageLicenseUrl>https://github.com/Esiur/Esiur-dotnet/blob/master/LICENSE</PackageLicenseUrl>
|
||||
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>1.8.8</Version>
|
||||
<Version>2.0.0-alpha</Version>
|
||||
<RepositoryUrl>https://github.com/esiur/esiur-dotnet</RepositoryUrl>
|
||||
<Authors>Ahmed Kh. Zamil</Authors>
|
||||
<AssemblyVersion>1.8.8.0</AssemblyVersion>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
<Company>Esiur Foundation</Company>
|
||||
<FileVersion>1.8.8.0</FileVersion>
|
||||
<FileVersion>2.0.0.0</FileVersion>
|
||||
<AssemblyName>Esiur</AssemblyName>
|
||||
<RootNamespace>Esiur</RootNamespace>
|
||||
<PackageId>Esiur</PackageId>
|
||||
<Product>Esiur</Product>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
@ -79,10 +79,13 @@
|
||||
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
|
||||
<!-- Package the Newtonsoft.Json dependency alongside the generator assembly -->
|
||||
<None Include="$(PkgSystem_Text_Json)\lib\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
|
||||
|
||||
|
||||
<None Include="Tools/*" Pack="true" PackagePath="tools/" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="LICENSE" Pack="true" PackagePath="">
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
21
Esiur/LICENSE
Normal file
21
Esiur/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2021 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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -42,8 +42,7 @@ using System.Text.Json;
|
||||
using Esiur.Resource;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Esiur.Misc
|
||||
{
|
||||
namespace Esiur.Misc;
|
||||
public static class Global
|
||||
{
|
||||
private static KeyList<string, object> variables = new KeyList<string, object>();
|
||||
@ -66,7 +65,8 @@ namespace Esiur.Misc
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Serialize(resource, Global.SerializeOptions);
|
||||
}catch (Exception ex)
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.ToString());
|
||||
return "{}";
|
||||
@ -487,4 +487,3 @@ namespace Esiur.Misc
|
||||
// Expression.IndexOf(
|
||||
//}
|
||||
}
|
||||
}
|
@ -31,8 +31,7 @@ using Esiur.Data;
|
||||
using Esiur.Net.Packets;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.DataLink
|
||||
{
|
||||
namespace Esiur.Net.DataLink;
|
||||
public abstract class PacketFilter : IResource
|
||||
{
|
||||
|
||||
@ -53,4 +52,3 @@ namespace Esiur.Net.DataLink
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,7 @@ using System.Runtime.InteropServices;
|
||||
using Esiur.Net.Packets;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.DataLink
|
||||
{
|
||||
namespace Esiur.Net.DataLink;
|
||||
public class PacketServer : IResource
|
||||
{
|
||||
List<PacketSource> sources = new List<PacketSource>();
|
||||
@ -120,4 +119,3 @@ namespace Esiur.Net.DataLink
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,8 +30,7 @@ using System.Text;
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.DataLink
|
||||
{
|
||||
namespace Esiur.Net.DataLink;
|
||||
public abstract class PacketSource : IResource
|
||||
{
|
||||
public delegate void NewPacket(Packet Packet);
|
||||
@ -92,4 +91,3 @@ namespace Esiur.Net.DataLink
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,7 @@ using Esiur.Misc;
|
||||
using System.Security.Cryptography;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
public class HTTPConnection : NetworkConnection
|
||||
{
|
||||
|
||||
@ -416,7 +415,8 @@ namespace Esiur.Net.HTTP
|
||||
{
|
||||
Close();
|
||||
}
|
||||
finally {
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -434,4 +434,3 @@ namespace Esiur.Net.HTTP
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
@ -35,8 +35,7 @@ using Esiur.Data;
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
|
||||
public abstract class HTTPFilter : IResource
|
||||
{
|
||||
@ -79,4 +78,3 @@ namespace Esiur.Net.HTTP
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -39,8 +39,7 @@ using Esiur.Net.Packets;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
public class HTTPServer : NetworkServer<HTTPConnection>, IResource
|
||||
{
|
||||
Dictionary<string, HTTPSession> sessions = new Dictionary<string, HTTPSession>();
|
||||
@ -297,4 +296,3 @@ namespace Esiur.Net.HTTP
|
||||
// cServer.StopServer();
|
||||
//}
|
||||
}
|
||||
}
|
@ -35,8 +35,7 @@ using Esiur.Data;
|
||||
using Esiur.Misc;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
public class HTTPSession : IDestructible //<T> where T : TClient
|
||||
{
|
||||
public delegate void SessionModifiedEvent(HTTPSession session, string key, object oldValue, object newValue);
|
||||
@ -127,4 +126,3 @@ namespace Esiur.Net.HTTP
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -6,8 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
public class IIPoHTTP : HTTPFilter
|
||||
{
|
||||
[Attribute]
|
||||
@ -36,4 +35,3 @@ namespace Esiur.Net.HTTP
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,7 @@ using Esiur.Net.IIP;
|
||||
using Esiur.Net.Sockets;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net.HTTP
|
||||
{
|
||||
namespace Esiur.Net.HTTP;
|
||||
public class IIPoWS : HTTPFilter
|
||||
{
|
||||
[Attribute]
|
||||
@ -121,5 +120,3 @@ namespace Esiur.Net.HTTP
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,7 @@ using System.Linq;
|
||||
using System.Diagnostics;
|
||||
using static Esiur.Net.Packets.IIPPacket;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
public partial class DistributedConnection : NetworkConnection, IStore
|
||||
{
|
||||
public delegate void ReadyEvent(DistributedConnection sender);
|
||||
@ -1278,4 +1277,3 @@ namespace Esiur.Net.IIP
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
|
||||
partial class DistributedConnection
|
||||
{
|
||||
KeyList<uint, DistributedResource> resources = new KeyList<uint, DistributedResource>();
|
||||
@ -2624,4 +2624,3 @@ namespace Esiur.Net.IIP
|
||||
.Done();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
public class DistributedPropertyContext
|
||||
{
|
||||
public object Value { get; private set; }
|
||||
@ -24,4 +23,3 @@ namespace Esiur.Net.IIP
|
||||
public static implicit operator DistributedPropertyContext(Func<DistributedConnection, object> method)
|
||||
=> new DistributedPropertyContext(method);
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,7 @@ using System.Threading.Tasks;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Resource.Template;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
|
||||
//[System.Runtime.InteropServices.ComVisible(true)]
|
||||
public class DistributedResource : DynamicObject, IResource
|
||||
@ -503,4 +502,3 @@ namespace Esiur.Net.IIP
|
||||
return new AsyncReply<bool>(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -28,7 +28,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
|
||||
public delegate void DistributedResourceEvent(DistributedResource sender, object argument);
|
||||
}
|
||||
|
@ -28,8 +28,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
public class DistributedResourceQueueItem
|
||||
{
|
||||
public enum DistributedResourceQueueItemType
|
||||
@ -70,4 +69,3 @@ namespace Esiur.Net.IIP
|
||||
get { return value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,8 +35,7 @@ using System.Net;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Security.Membership;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
public class DistributedServer : NetworkServer<DistributedConnection>, IResource
|
||||
{
|
||||
[Attribute]
|
||||
@ -174,4 +173,3 @@ namespace Esiur.Net.IIP
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,11 +28,9 @@ using System.Text;
|
||||
using Esiur.Net.Sockets;
|
||||
using Esiur.Security.Authority;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
public class DistributedSession : NetworkSession
|
||||
{
|
||||
public Source Source { get; set; }
|
||||
public Authentication Authentication { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -29,12 +29,11 @@ using Esiur.Data;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Resource.Template;
|
||||
|
||||
namespace Esiur.Net.IIP
|
||||
{
|
||||
namespace Esiur.Net.IIP;
|
||||
|
||||
public abstract class EntryPoint : Esiur.Resource.Resource
|
||||
{
|
||||
|
||||
public abstract AsyncReply<IResource[]> Query(string path, DistributedConnection sender);
|
||||
protected abstract override bool Create();
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
|
||||
public interface INetworkReceiver<T>
|
||||
{
|
||||
void NetworkClose(T sender);
|
||||
@ -12,4 +12,3 @@ namespace Esiur.Net
|
||||
|
||||
void NetworkConnect(T sender);
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,7 @@ using System.Text;
|
||||
using Esiur.Data;
|
||||
using Esiur.Misc;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
public class NetworkBuffer
|
||||
{
|
||||
byte[] data;
|
||||
@ -205,4 +204,3 @@ namespace Esiur.Net
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,8 +36,7 @@ using Esiur.Data;
|
||||
using Esiur.Net.Sockets;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
public abstract class NetworkConnection : IDestructible, INetworkReceiver<ISocket>// <TS>: IResource where TS : NetworkSession
|
||||
{
|
||||
private Sockets.ISocket sock;
|
||||
@ -364,4 +363,3 @@ namespace Esiur.Net
|
||||
//throw new NotImplementedException();
|
||||
//}
|
||||
}
|
||||
}
|
@ -33,14 +33,13 @@ using Esiur.Resource;
|
||||
using System.Threading.Tasks;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
|
||||
public abstract class NetworkServer<TConnection> : IDestructible where TConnection : NetworkConnection, new()
|
||||
{
|
||||
//private bool isRunning;
|
||||
private Sockets.ISocket listener;
|
||||
public AutoList<TConnection, NetworkServer<TConnection>> Connections { get; private set; }
|
||||
public AutoList<TConnection, NetworkServer<TConnection>> Connections { get; internal set; }
|
||||
|
||||
private Thread thread;
|
||||
|
||||
@ -308,4 +307,3 @@ namespace Esiur.Net
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -35,8 +35,7 @@ using Esiur.Data;
|
||||
using Esiur.Misc;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
public class NetworkSession : IDestructible //<T> where T : TClient
|
||||
{
|
||||
public delegate void SessionModifiedEvent(NetworkSession session, string key, object oldValue, object newValue);
|
||||
@ -127,4 +126,3 @@ namespace Esiur.Net
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -32,8 +32,7 @@ using Esiur.Data;
|
||||
using System.Net;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
public class HTTPRequestPacket : Packet
|
||||
{
|
||||
|
||||
@ -314,5 +313,3 @@ namespace Esiur.Net.Packets
|
||||
return headerSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,7 @@ using System.Text;
|
||||
using Esiur.Misc;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
public class HTTPResponsePacket : Packet
|
||||
{
|
||||
|
||||
@ -301,4 +300,3 @@ namespace Esiur.Net.Packets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,8 +31,7 @@ using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
class IIPAuthPacket : Packet
|
||||
{
|
||||
public enum IIPAuthPacketCommand : byte
|
||||
@ -412,4 +411,4 @@ namespace Esiur.Net.Packets
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,8 +32,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
class IIPPacket : Packet
|
||||
{
|
||||
|
||||
@ -827,4 +826,3 @@ namespace Esiur.Net.Packets
|
||||
return offset - originalOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
|
||||
struct IIPPacketAttachInfo
|
||||
{
|
||||
public string Link;
|
||||
@ -19,4 +19,3 @@ namespace Esiur.Net.Packets
|
||||
Link = link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,7 @@ using Esiur.Net.DataLink;
|
||||
using System.Net.NetworkInformation;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
internal static class Functions
|
||||
{
|
||||
public static void AddData(ref byte[] dest, byte[] src)
|
||||
@ -363,7 +362,6 @@ namespace Esiur.Net.Packets
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/************************************ EOF *************************************/
|
||||
|
||||
|
||||
|
@ -29,8 +29,7 @@ using System.Text;
|
||||
using Esiur.Misc;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.Packets
|
||||
{
|
||||
namespace Esiur.Net.Packets;
|
||||
public class WebsocketPacket : Packet
|
||||
{
|
||||
public enum WSOpcode : byte
|
||||
@ -214,4 +213,3 @@ namespace Esiur.Net.Packets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Net
|
||||
{
|
||||
namespace Esiur.Net;
|
||||
|
||||
public class SendList : BinaryList
|
||||
{
|
||||
NetworkConnection connection;
|
||||
@ -23,4 +23,3 @@ namespace Esiur.Net
|
||||
return reply;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,8 +36,7 @@ using System.Collections.Concurrent;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net.Sockets
|
||||
{
|
||||
namespace Esiur.Net.Sockets;
|
||||
//public delegate void ISocketReceiveEvent(NetworkBuffer buffer);
|
||||
//public delegate void ISocketConnectEvent();
|
||||
//public delegate void ISocketCloseEvent();
|
||||
@ -71,4 +70,3 @@ namespace Esiur.Net.Sockets
|
||||
|
||||
void Unhold();
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,7 @@ using Esiur.Resource;
|
||||
using System.Threading.Tasks;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.Sockets
|
||||
{
|
||||
namespace Esiur.Net.Sockets;
|
||||
public class SSLSocket : ISocket
|
||||
{
|
||||
|
||||
@ -552,4 +551,4 @@ namespace Esiur.Net.Sockets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,8 +28,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.Sockets
|
||||
{
|
||||
namespace Esiur.Net.Sockets;
|
||||
public enum SocketState
|
||||
{
|
||||
Initial,
|
||||
@ -39,4 +38,3 @@ namespace Esiur.Net.Sockets
|
||||
Closed,
|
||||
//Terminated
|
||||
}
|
||||
}
|
||||
|
@ -35,8 +35,7 @@ using Esiur.Resource;
|
||||
using System.Threading.Tasks;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.Sockets
|
||||
{
|
||||
namespace Esiur.Net.Sockets;
|
||||
public class TCPSocket : ISocket
|
||||
{
|
||||
public INetworkReceiver<ISocket> Receiver { get; set; }
|
||||
@ -656,4 +655,3 @@ namespace Esiur.Net.Sockets
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -36,8 +36,7 @@ using Esiur.Resource;
|
||||
using Esiur.Data;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Esiur.Net.Sockets
|
||||
{
|
||||
namespace Esiur.Net.Sockets;
|
||||
public class WSocket : ISocket, INetworkReceiver<ISocket>
|
||||
{
|
||||
WebsocketPacket pkt_receive = new WebsocketPacket();
|
||||
@ -358,4 +357,3 @@ namespace Esiur.Net.Sockets
|
||||
Receiver?.NetworkConnect(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -32,9 +32,9 @@ using System.Collections;
|
||||
using Esiur.Misc;
|
||||
using Esiur.Data;
|
||||
|
||||
namespace Esiur.Net.TCP
|
||||
namespace Esiur.Net.TCP;
|
||||
public class TCPConnection : NetworkConnection
|
||||
{
|
||||
public class TCPConnection:NetworkConnection {
|
||||
|
||||
private KeyList<string, object> variables = new KeyList<string, object>();
|
||||
|
||||
@ -63,4 +63,3 @@ namespace Esiur.Net.TCP
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ using Esiur.Net.Sockets;
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.TCP
|
||||
{
|
||||
namespace Esiur.Net.TCP;
|
||||
|
||||
public abstract class TCPFilter : IResource
|
||||
{
|
||||
public Instance Instance
|
||||
@ -63,4 +63,3 @@ namespace Esiur.Net.TCP
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -34,8 +34,7 @@ using Esiur.Core;
|
||||
using System.Net;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.TCP
|
||||
{
|
||||
namespace Esiur.Net.TCP;
|
||||
public class TCPServer : NetworkServer<TCPConnection>, IResource
|
||||
{
|
||||
|
||||
@ -153,4 +152,3 @@ namespace Esiur.Net.TCP
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,10 +28,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Net.TCP
|
||||
{
|
||||
namespace Esiur.Net.TCP;
|
||||
public class TCPSession : NetworkSession
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,7 @@ using Esiur.Data;
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
|
||||
namespace Esiur.Net.UDP
|
||||
{
|
||||
namespace Esiur.Net.UDP;
|
||||
public abstract class UDPFilter : IResource
|
||||
{
|
||||
public Instance Instance
|
||||
@ -54,4 +53,3 @@ namespace Esiur.Net.UDP
|
||||
OnDestroy?.Invoke(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -33,8 +33,7 @@ using Esiur.Misc;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Net.UDP
|
||||
{
|
||||
namespace Esiur.Net.UDP;
|
||||
|
||||
/* public class IIPConnection
|
||||
{
|
||||
@ -201,4 +200,3 @@ namespace Esiur.Net.UDP
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,8 @@ using Esiur.Data;
|
||||
using System.IO;
|
||||
using Esiur.Core;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
|
||||
[Generator]
|
||||
public class ResourceGenerator : ISourceGenerator
|
||||
{
|
||||
@ -181,11 +181,10 @@ public virtual void Destroy() {{ OnDestroy?.Invoke(this); }}
|
||||
context.AddSource(ci.Name + ".Generated.cs", code);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch //(Exception ex)
|
||||
{
|
||||
//System.IO.File.AppendAllText("c:\\gen\\error.log", ci.Name + " " + ex.ToString() + "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
public struct ResourceGeneratorClassInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
@ -18,4 +17,3 @@ namespace Esiur.Proxy
|
||||
public ClassDeclarationSyntax ClassDeclaration { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,11 +3,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
public struct ResourceGeneratorFieldInfo
|
||||
{
|
||||
public IFieldSymbol FieldSymbol { get; set; }
|
||||
public string[] Attributes { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
public class ResourceGeneratorReceiver : ISyntaxContextReceiver
|
||||
{
|
||||
|
||||
@ -74,7 +73,8 @@ namespace Esiur.Proxy
|
||||
c.HasInterface = cls.Interfaces.Any(x => x.ToDisplayString() == "Esiur.Resource.IResource");
|
||||
if (!c.HasTrigger)
|
||||
c.HasTrigger = hasTrigger;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
Classes.Add(fullName, new ResourceGeneratorClassInfo()
|
||||
{
|
||||
@ -94,4 +94,3 @@ namespace Esiur.Proxy
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,8 +7,7 @@ using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Text;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
public static class ResourceProxy
|
||||
{
|
||||
static Dictionary<Type, Type> cache = new Dictionary<Type, Type>();
|
||||
@ -252,4 +251,3 @@ namespace Esiur.Proxy
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,7 @@ using Esiur.Resource;
|
||||
using Esiur.Net.IIP;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Esiur.Proxy
|
||||
{
|
||||
namespace Esiur.Proxy;
|
||||
public static class TemplateGenerator
|
||||
{
|
||||
internal static Regex urlRegex = new Regex(@"^(?:([\S]*)://([^/]*)/?)");
|
||||
@ -235,4 +234,3 @@ namespace Esiur.Proxy
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user