How to use C# object[] in python
![](https://secure.gravatar.com/avatar/97c111ec66592773d7100f555d2dc74d.jpg?s=120&d=mm&r=g)
I am trying to use one of data struct class defined in c# dll to python script. I am facing difficulty in adding c# object under payload. Can anyone give me hint or any example which will useful for assigning payload under object array. public class TestPayload { public string RequestId { get; set; } public byte[] ServiceIds { get; set; } public object[] Payload { get; set; } public bool IsStatus { get; set; } public long ExpiryDateTime { get; set; } } Note : I am able to add other parameter defined in class & pass from python script to c#. Thanks
![](https://secure.gravatar.com/avatar/97c111ec66592773d7100f555d2dc74d.jpg?s=120&d=mm&r=g)
Any hint or input on raised query will be helpful. Thanks On Mon, Apr 16, 2018 at 9:49 AM, techi eth <techieth@gmail.com> wrote:
I am trying to use one of data struct class defined in c# dll to python script. I am facing difficulty in adding c# object under payload. Can anyone give me hint or any example which will useful for assigning payload under object array.
public class TestPayload
{
public string RequestId { get; set; }
public byte[] ServiceIds { get; set; }
public object[] Payload { get; set; }
public bool IsStatus { get; set; }
public long ExpiryDateTime { get; set; }
}
Note : I am able to add other parameter defined in class & pass from python script to c#.
Thanks
![](https://secure.gravatar.com/avatar/1b0e722a4823f29c56d7a97bc6500ccc.jpg?s=120&d=mm&r=g)
Is this a problem only for array of objects or the object itself? Might be this issue: https://github.com/pythonnet/pythonnet/issues/94 On Wed, Apr 18, 2018, 8:20 AM techi eth <techieth@gmail.com> wrote:
Any hint or input on raised query will be helpful.
Thanks
On Mon, Apr 16, 2018 at 9:49 AM, techi eth <techieth@gmail.com> wrote:
I am trying to use one of data struct class defined in c# dll to python script. I am facing difficulty in adding c# object under payload. Can anyone give me hint or any example which will useful for assigning payload under object array.
public class TestPayload
{
public string RequestId { get; set; }
public byte[] ServiceIds { get; set; }
public object[] Payload { get; set; }
public bool IsStatus { get; set; }
public long ExpiryDateTime { get; set; }
}
Note : I am able to add other parameter defined in class & pass from python script to c#.
Thanks
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org https://mail.python.org/mailman/listinfo/pythondotnet
![](https://secure.gravatar.com/avatar/97c111ec66592773d7100f555d2dc74d.jpg?s=120&d=mm&r=g)
Thanks. that helps to me.Now i am able to pass Object & Object array from python to C# On Wed, Apr 18, 2018 at 8:57 PM, Denis Akhiyarov <denis.akhiyarov@gmail.com> wrote:
Is this a problem only for array of objects or the object itself?
Might be this issue:
https://github.com/pythonnet/pythonnet/issues/94
On Wed, Apr 18, 2018, 8:20 AM techi eth <techieth@gmail.com> wrote:
Any hint or input on raised query will be helpful.
Thanks
On Mon, Apr 16, 2018 at 9:49 AM, techi eth <techieth@gmail.com> wrote:
I am trying to use one of data struct class defined in c# dll to python script. I am facing difficulty in adding c# object under payload. Can anyone give me hint or any example which will useful for assigning payload under object array.
public class TestPayload
{
public string RequestId { get; set; }
public byte[] ServiceIds { get; set; }
public object[] Payload { get; set; }
public bool IsStatus { get; set; }
public long ExpiryDateTime { get; set; }
}
Note : I am able to add other parameter defined in class & pass from python script to c#.
Thanks
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org https://mail.python.org/mailman/listinfo/pythondotnet
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org https://mail.python.org/mailman/listinfo/pythondotnet
participants (2)
-
Denis Akhiyarov
-
techi eth