neo-project / neo-modules

MIT License
61 stars 102 forks source link

Avoid re-init properties #902

Closed shargon closed 2 months ago

shargon commented 2 months ago

Related to https://github.com/neo-project/neo-modules/pull/898/files#r1584389953

shargon commented 2 months ago

you have to initialize each one

Are always initialized, isn't it?

cschuchardt88 commented 2 months ago

No, you would have to do something like this:

var obj = new AClass()
{
  AProperty = new(),
}
shargon commented 2 months ago

No, you would have to do something like this:

var obj = new AClass()
{
  AProperty = new(),
}

It's currently done, otherwise you will have a default unused value, that will be changed in Create method

cschuchardt88 commented 2 months ago

Yes, But if someone was do bytes.AsSerializable<AClass>() it would throw that exception. This library was importable for other plugins to access the store.

Lets have @superboyiii test 1st. before merge.

shargon commented 2 months ago

Yes, But if someone was do bytes.AsSerializable<AClass>() it would throw that exception. This library was importable for other plugins to access the store.

Lets have @superboyiii test 1st. before merge.

Good point, but it call Deserialize

shargon commented 2 months ago

Repository moved to neo, please re-open there