예제 #1
0
        private static void InitializeSerialization()
        {
            var conventions = new ConventionProfile();

            conventions.SetDefaultValueConvention(new EmptyGuidDefaultValueConvention());
            conventions.SetSerializeDefaultValueConvention(new NeverSerializeDefaultValueConvention());
            BsonClassMap.RegisterConventions(conventions, type => type.FullName.StartsWith("MongoDB.BsonUnitTests.Jira.CSharp310Tests"));
        }
예제 #2
0
        private static void InitializeSerialization()
        {
            var conventions = new ConventionProfile();

            conventions.SetDefaultValueConvention(new EmptyGuidDefaultValueConvention());
#pragma warning disable 618 // SetSerializeDefaultValueConvention and NeverSerializeDefaultValueConvention are obsolete
            conventions.SetSerializeDefaultValueConvention(new NeverSerializeDefaultValueConvention());
#pragma warning restore 618
            BsonClassMap.RegisterConventions(conventions, type => type.FullName.StartsWith("MongoDB.BsonUnitTests.Jira.CSharp310Tests", StringComparison.Ordinal));
        }