mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-27 05:23:13 +00:00
flow
This commit is contained in:
@ -1909,7 +1909,7 @@ partial class DistributedConnection
|
||||
|
||||
|
||||
if (pi.PropertyType.IsGenericType && pi.PropertyType.GetGenericTypeDefinition()
|
||||
== typeof(DistributedPropertyContext<>))
|
||||
== typeof(PropertyContext<>))
|
||||
{
|
||||
value = Activator.CreateInstance(pi.PropertyType, this, value);
|
||||
//value = new DistributedPropertyContext(this, value);
|
||||
|
@ -4,30 +4,30 @@ using System.Text;
|
||||
|
||||
namespace Esiur.Net.IIP;
|
||||
|
||||
public interface IDistributedPropertyContext
|
||||
public interface IPropertyContext
|
||||
{
|
||||
object GetValue(DistributedConnection connection);
|
||||
}
|
||||
|
||||
public class DistributedPropertyContext<T> : IDistributedPropertyContext
|
||||
public class PropertyContext<T> : IPropertyContext
|
||||
{
|
||||
public T Value { get; private set; }
|
||||
public DistributedConnection Connection { get; private set; }
|
||||
public Func<DistributedConnection, T> Method { get; private set; }
|
||||
|
||||
public DistributedPropertyContext(DistributedConnection connection, T value)
|
||||
public PropertyContext(DistributedConnection connection, T value)
|
||||
{
|
||||
this.Value = value;
|
||||
this.Connection = connection;
|
||||
}
|
||||
|
||||
public DistributedPropertyContext(Func<DistributedConnection, T> method)
|
||||
public PropertyContext(Func<DistributedConnection, T> method)
|
||||
{
|
||||
this.Method = method;
|
||||
}
|
||||
|
||||
public static implicit operator DistributedPropertyContext<T>(Func<DistributedConnection, T> method)
|
||||
=> new DistributedPropertyContext<T>(method);
|
||||
public static implicit operator PropertyContext<T>(Func<DistributedConnection, T> method)
|
||||
=> new PropertyContext<T>(method);
|
||||
|
||||
public object GetValue(DistributedConnection connection)
|
||||
{
|
Reference in New Issue
Block a user