fix(codegen): Adds access modifiers to serializable fields (#633)
- [X] Adds options for SerializableField. Example: ```cs [SerializableField(0, getter: "protected", setter: "protected", isVritual: true)] private int _someField; ``` Defaults: `getter: "public", setter: "public", isVirtual: false`
This commit is contained in:
parent
72d3966541
commit
803b4a33cb
33 changed files with 183 additions and 164 deletions
|
|
@ -13,7 +13,6 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
*************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -58,6 +57,7 @@ namespace SerializableMigration
|
|||
{
|
||||
var text = File.ReadAllText(file, Encoding.UTF8);
|
||||
migration = JsonSerializer.Deserialize<SerializableMetadata>(text, options);
|
||||
_cache[fi.Name] = migration;
|
||||
}
|
||||
|
||||
if (typeName == migration!.Type && version > migration.Version)
|
||||
|
|
@ -96,6 +96,7 @@ namespace SerializableMigration
|
|||
}
|
||||
|
||||
migration = JsonSerializer.Deserialize<SerializableMetadata>(text, options);
|
||||
_cache[fi.Name] = migration;
|
||||
}
|
||||
|
||||
if (typeName == migration!.Type && version > migration.Version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue