Remove obsolete serialization - #476
Merged
Merged
Conversation
Base constructor is marked as obsolete as well as ours, NET 10 removes them completely
- No ISerializable based serialization - Added support for serialization via DataContract and JsonSerializer - Added tests and fixed some issues (some of fixes were ported from main branch) - Delete test (the case is already covered in another test)
- Cloning via BinaryFormatter is marked as obsolete until in use - Added Cloning via DataContractSerializer, DataContractJsonSerializer and JsonSerializer - added domains of types to use them for DataContract-based serialization
- Xtensive.Orm contains only API basis and usage to create and register operations. - All the real operations are outside main library, it made creation, modification, deletion of Entities faster when no registration needed, as well as EntitySet.Add/Remove/Clear operations
Before that, EntityFieldSet operation grabbed persistent object, which exists in session context, so it is not good. Now there is NestedOperations collection for all nested fields that persistent structure suppose to change on Field change
and also some of tests of serialization
- Binary serialization is almost eliminated in .NET, there is no point of them to be serializable
…orrect package settings
- created base type with separated tests for each target type (get from CombinedTest) - main tests were moved to new generic base type - make converstion based testing, if there is a conversion test runs, otherwise ignored - added DateOnly/TimeOnly conversion test - info messages replaced to error messages in log in case of exceptions - add category for tests - use log only if it is enabled
- json converters that can serialize - Extension to add the converters (domain required including)
# Conflicts:
# ChangeLog/7.3.0-Beta-1-dev.txt
# Extensions/Xtensive.Orm.Operations/Operations/EntitySetOperation.cs
# Extensions/Xtensive.Orm.SerializableExpressions/Internals/SerializableExpressionToExpressionConverter.cs
# Orm.sln
# Orm/Xtensive.Orm.Tests.Core/Linq/SerializableExpressionsTest.cs
# Orm/Xtensive.Orm.Tests.Core/Tuples/TupleDescriptorTest.cs
# Orm/Xtensive.Orm.Tests.Framework/Internals/InstanceGeneratorBase.cs
# Orm/Xtensive.Orm.Tests/Interfaces/KeyStructureConflictTest.cs
# Orm/Xtensive.Orm.Tests/Interfaces/TypeIdModeConflictTest.cs
# Orm/Xtensive.Orm.Tests/Interfaces/UnusedTypeRemovalTest.cs
# Orm/Xtensive.Orm.Tests/Issues/Issue0262_StructureAssignment.cs
# Orm/Xtensive.Orm.Tests/Issues/IssueJira0197_ExtendedErrorInformation.cs
# Orm/Xtensive.Orm.Tests/Linq/CustomExpressionCompilers.cs
# Orm/Xtensive.Orm/Arithmetic/ArithmeticBase.cs
# Orm/Xtensive.Orm/Collections/Deque.cs
# Orm/Xtensive.Orm/Collections/ExtensionCollection.cs
# Orm/Xtensive.Orm/Collections/FixedList3.cs
# Orm/Xtensive.Orm/Collections/Graphs/Edge.cs
# Orm/Xtensive.Orm/Collections/TypeRegistration.cs
# Orm/Xtensive.Orm/Collections/TypeRegistrationProcessorBase.cs
# Orm/Xtensive.Orm/Collections/TypeRegistry.cs
# Orm/Xtensive.Orm/Conversion/AdvancedConverterBase.cs
# Orm/Xtensive.Orm/Conversion/Internals/ConvertingEnumerator.cs
# Orm/Xtensive.Orm/Linq/Internals/ExpressionComparer.cs
# Orm/Xtensive.Orm/Linq/SerializableExpressions/Internals/ExpressionToSerializableExpressionConverter.cs
# Orm/Xtensive.Orm/Linq/SerializableExpressions/Internals/ReflectionExtensions.cs
# Orm/Xtensive.Orm/Modelling/Actions/PropertyChangeAction.cs
# Orm/Xtensive.Orm/Modelling/Actions/RemoveNodeAction.cs
# Orm/Xtensive.Orm/Modelling/Comparison/Hints/CopyDataHint.cs
# Orm/Xtensive.Orm/Modelling/Comparison/Hints/UpdateDataHint.cs
# Orm/Xtensive.Orm/Modelling/NodeCollection.cs
# Orm/Xtensive.Orm/Orm/Configuration/NameMappingCollection.cs
# Orm/Xtensive.Orm/Orm/EntitySetBase.cs
# Orm/Xtensive.Orm/Orm/Internals/EntitySetTypeState.cs
# Orm/Xtensive.Orm/Orm/Internals/Prefetch/ReferencedEntityContainer.cs
# Orm/Xtensive.Orm/Orm/Model/TypeDiscriminatorMap.cs
# Orm/Xtensive.Orm/Orm/Operations/KeySetOperation.cs
# Orm/Xtensive.Orm/Orm/Rse/AggregateColumn.cs
# Orm/Xtensive.Orm/Orm/Rse/CalculatedColumn.cs
# Orm/Xtensive.Orm/Orm/Rse/MappedColumn.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/AggregateProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/AliasProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/CalculateProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/ExceptProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/FilterProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/IncludeProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/IntersectProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/JoinProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/OrderProviderBase.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/PredicateJoinProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Compilable/RawProvider.cs
# Orm/Xtensive.Orm/Orm/Rse/Providers/Provider.cs
# Orm/Xtensive.Orm/Orm/Rse/SystemColumn.cs
# Orm/Xtensive.Orm/Orm/Serialization/SerializationContext.cs
# Orm/Xtensive.Orm/Orm/Upgrade/Model/PrimaryIndexInfo.cs
# Orm/Xtensive.Orm/Orm/Upgrade/Model/SecondaryIndexInfo.cs
# Orm/Xtensive.Orm/Orm/Upgrade/Model/StorageFullTextIndexInfo.cs
# Orm/Xtensive.Orm/Sorting/Node.cs
# Orm/Xtensive.Orm/Sql/Ddl/SqlAlterSequence.cs
# Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCase.cs
# Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCursor.cs
# Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlDefaultValue.cs
# Orm/Xtensive.Orm/Sql/Model/Sequence.cs
# Orm/Xtensive.Orm/Tuples/Transform/CombineTransform.cs
# Orm/Xtensive.Orm/Tuples/Transform/Internals/MapTransformTuple.cs
# Orm/Xtensive.Orm/Tuples/Transform/Internals/MapTransformTuple1.cs
# Orm/Xtensive.Orm/Tuples/Transform/Internals/MapTransformTuple3.cs
# Orm/Xtensive.Orm/Tuples/Transform/Internals/ReadOnlyTransformTuple.cs
# Orm/Xtensive.Orm/Tuples/Transform/MapTransform.cs
# Orm/Xtensive.Orm/Tuples/Transform/ReadOnlyTransform.cs
# Orm/Xtensive.Orm/Tuples/Transform/TransformedTuple.cs
# Orm/Xtensive.Orm/Tuples/Transform/TransformedTuple{TTupleTransform}.cs
# Orm/Xtensive.Orm/Tuples/Transform/TupleTransformBase.cs
# Orm/Xtensive.Orm/Tuples/Transform/WrappingTransformTupleBase.cs
# Orm/Xtensive.Orm/Tuples/TupleDescriptor.cs
new items + typo fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Destroyed binary serialization usage - no type implements
ISerializablenorIDeserializationCallback, all the types which are not supposed to be serialized lost their [Serializable] attribute.In particular,
Persistenttypes (Entity,EntitySet<T>,Structure) no longer serializable via obsolete binary serialization. Current recommended approach in dotnet is to create DTOs to manage what exactly serialized and how deep serialization should be, which prevents accidental fetching of the whole graph of data from database.SerializableExpressions API was moved out main library to extension Xtensive.Orm.SerializableExpressions. They remain being able to be serialized and supportJsonSerializerandDataContractserialization.Operations API was moved out main library to extension Xtensive.Orm.Operations, except for abstractions needed to exist inside main library, so this improved speed o entity operations in main scenario when no operation registered. Operations can be serialized by
JsonSerializer, also addedJsonConvertersand an extension to add them toJsonSerializerOptions.Converterscollections.Removes serialization tests or parts of tests that performed such
Other changes that appeared during main task
TupleUpdateris obsolete] because it is not in use so will be removed.IntegrityExceptionis obsoleteReferenceInfo,SyncActionstructs became readonly, properties replaced with readonly fieldsColumnInfoRefproperties replaced with readonly fieldsPrefetchProcessorremovedAdvancedConvetersfor types likeDateOnly,TimeOnly,DateTimeOffsetandbyte[]to other types and from other types, adding conversion to string fixedTupleFormatExtensions.Format(this Tuple)andTupleFormatExtensions.Parse(this TupleDescriptor, string)extension methods, which could not work for some of real-life tuples from actual entities. Tests for conversions and tuple operations added. This was required for tuple serialization.AdvancedConverters tests improved, now most of them have unified structure with superset of tests, one for each possible target type; possible target types for converter declared in each test class; if conversion is impossible test is ignored.