2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-05-06 03:32:57 +00:00

InvocationContext

This commit is contained in:
Ahmed Zamil 2024-12-07 15:31:29 +03:00
parent 07561062ca
commit 979a30805e
2 changed files with 5 additions and 3 deletions

View File

@ -1528,7 +1528,8 @@ partial class DistributedConnection
try
{
rt = ft.MethodInfo.Invoke(target, args);
context.Ended = true;
if (context != null)
context.Ended = true;
}
catch (Exception ex)
{

View File

@ -88,7 +88,7 @@ public class FunctionTemplate : MemberTemplate
{
rtType = RepresentationType.FromType(mi.ReturnType.GetGenericArguments()[0]);
}
else if (genericRtType == typeof(IEnumerable<>) || genericRtType == typeof(IAsyncEnumerable<>))
else if (genericRtType == typeof(IEnumerable<>))// || genericRtType == typeof(IAsyncEnumerable<>))
{
// get export
rtType = RepresentationType.FromType(mi.ReturnType.GetGenericArguments()[0]);
@ -158,7 +158,8 @@ public class FunctionTemplate : MemberTemplate
if (args.Length > 0)
{
if (args.Last().ParameterType == typeof(DistributedConnection))
if (args.Last().ParameterType == typeof(DistributedConnection)
|| args.Last().ParameterType == typeof(InvocationContext))
args = args.Take(args.Count() - 1).ToArray();
}