Serialize json in wcf

1

I'm implementing a web service with a many to many relationship, but the GET method throws me the following error:

  

System.Runtime.Serialization.SerializationException: 'The expected   kind   'System.Collections.Generic.List'1 [[WebApplication3.ViewModel.ActivitiesViewModel,   Models, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null]] 'with   the name of the data contract   'ArrayOfActivitiesViewModel: link '.   If you are using DataContractSerializer, try using   DataContractResolver or add statically not known types to the   list of known types (for example, using the attribute   KnownTypeAttribute or adding them to the list of known types that are   pass to DataContractSerializer). '

Investigating a bit I find that you have to put the attribute [KnownType(typeof(Subclase)] in the entities but I can not correct the error with that.

    
asked by Steven Giraldo 23.10.2018 в 03:07
source

0 answers