Training
Module
Store and Retrieve JSON Files - Training
Learn how to serialize and deserialize JavaScript Object Notation (JSON) strings using the JsonSerializer class, the JsonSerializerOptions class, and Data Transfer Objects.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You can make entities serializable when you generate your code. Entity classes are decorated with the DataContractAttribute attribute, and columns with the DataMemberAttribute attribute.
Developers using Visual Studio can use the Object Relational Designer for this purpose.
If you are using the SQLMetal command-line tool, use the /serialization option with the unidirectional
argument. For more information, see SqlMetal.exe (Code Generation Tool).
The following SQLMetal command lines produce files that have serializable entities.
sqlmetal /code:nwserializable.vb /language:vb "c:\northwnd.mdf" /sprocs /functions /pluralize /serialization:unidirectional
sqlmetal /code:nwserializable.cs /language:csharp "c:\northwnd.mdf" /sprocs /functions /pluralize /serialization:unidirectional
Training
Module
Store and Retrieve JSON Files - Training
Learn how to serialize and deserialize JavaScript Object Notation (JSON) strings using the JsonSerializer class, the JsonSerializerOptions class, and Data Transfer Objects.
Documentation
How to: Customize Entity Classes by Using the Code Editor - ADO.NET
Learn more about: How to: Customize Entity Classes by Using the Code Editor
How to: Generate the Object Model as an External File - ADO.NET
Learn more about: How to: Generate the Object Model as an External File
How to: Filter Related Data - ADO.NET
Learn more about: How to: Filter Related Data