Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
[deleted comment]
Just to give an example why I need it:
static void Main(string[] args)
{
var command = new AddOrganizationCommand
{
CompanyStartedDate = DateTime.UtcNow,
Description = "some description",
Name = "some name",
PhoneNumber = "0857135496",
Header =
new MessageHeader
{
Name = "some header name",
DateSent = DateTime.UtcNow,
EndpointDestination = "some destination",
EndpointOrigin = "some origin",
MessageId = Guid.NewGuid()
}
};
var memoryStream = new MemoryStream();
Serializer.Serialize(memoryStream, command);
memoryStream.Position = 0;
//Type name will be saved in a key(type name)/value dictionary
var type = Type.GetType("Protobuf.AddOrganizationCommand");
var addOrganizationCommand = Serializer.Deserialize(memoryStream, type);
}
Original comment by metitus
on 22 Aug 2013 at 11:41
Please see: Serializer.NonGeneric
Original comment by marc.gravell
on 22 Aug 2013 at 11:43
No idea why you created the NonGeneric namespace, you could have
generic/non-generic overload methods in the same class, but anyway that is your
decision :)
Thanks
Original comment by metitus
on 22 Aug 2013 at 11:46
Note, in the v2 API, the "real" code is TypeModel *anyway* (Serializer.* just
calls through to RuntimeTypeModel.Default) - and TypeModel is *entirely*
non-generic.
Original comment by marc.gravell
on 22 Aug 2013 at 12:34
I understand, but all I am saying is that you could make the the API look a bit
simpler.
Either way you're doing a very nice work here.
Thanks
Original comment by metitus
on 22 Aug 2013 at 1:05
Original issue reported on code.google.com by
metitus
on 22 Aug 2013 at 11:25