The following class was automatically generated from the template using the Entity Framework model.
namespace Entities
{
using System;
using System.Collections.Generic;
public partial class Country
{
public Country()
{
this.Regions = new HashSet<Region>();
}
public long CountryId { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public bool Preferred { get; set; }
public System.DateTime LastChanged { get; set; }
public virtual ICollection<Region> Regions { get; set; }
}
}
I have a Wcf web service that returns only POX (Xml) and Json. I want to return my own serialized object, for example:
public class MyResponseObject
{
public int RequestId {get;set;}
public List<Country> CountryList {get;set;}
}
But I do not want to return an ICollection of regions.
Then the object can be returned using something like
Newtonsoft.Json.JsonConvert.SerializeObject ()
Will I best get my own serialized POCO object back this way?
source
share