locked
How to convert this c# code to vb.net ? RRS feed

  • Question

  • User-535616387 posted

    Hi Guys, 

    How to convert this c# code to vb.net ?

    this code works in c# but i would like to use this code in vb.net project, i have tried convert using this tools but no result : (telerik,developerfusion, etc)

     internal class Converter
        {
            public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
            {
                MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
                DateParseHandling = DateParseHandling.None,
                Converters = { 
                    new IsoDateTimeConverter()
                    {
                        DateTimeStyles = DateTimeStyles.AssumeUniversal,
                    },
                },
            };
        }

    Thanks & Best Regards,
    wibowo.wiwit

    Saturday, March 3, 2018 2:02 PM

Answers

  • User-284744251 posted

    Try following code

    Friend Class Converter
    
        Public Shared ReadOnly Settings As JsonSerializerSettings = New JsonSerializerSettings With {.MetadataPropertyHandling = MetadataPropertyHandling.Ignore, .DateParseHandling = DateParseHandling.None, .Converters = {New IsoDateTimeConverter() With {.DateTimeStyles = DateTimeStyles.AssumeUniversal}}}
    End Class

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 3, 2018 3:28 PM

All replies

  • User-284744251 posted

    Try following code

    Friend Class Converter
    
        Public Shared ReadOnly Settings As JsonSerializerSettings = New JsonSerializerSettings With {.MetadataPropertyHandling = MetadataPropertyHandling.Ignore, .DateParseHandling = DateParseHandling.None, .Converters = {New IsoDateTimeConverter() With {.DateTimeStyles = DateTimeStyles.AssumeUniversal}}}
    End Class

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 3, 2018 3:28 PM
  • User-535616387 posted

    yaaay it works.

    Thanks Khanna..

    Sunday, March 4, 2018 9:15 AM