I am using Json.Net library to convert objects to json and back to objects.
I have an interface:
public interface IGoods
{
List<IPen> Pens { get; set; }
List<IPencil> Pencils{ get; set; }
void Deserialize(String json);
}
implementation:
new public void Deserialize(String json)
{
JsonConvert.DeserializeObject<Goods>(json);
}
The obvious error I got is: Could not create an instance of type Project.IPen. Type is an interface or abstract class and cannot be instantated.
How do I overcome this error?
Thanks!