The following class was Auto generated from a 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 POX (Xml) and Json only. I am wanting to return my own serialised object like;
public class MyResponseObject { public int RequestId {get;set;} public List<Country> CountryList {get;set;} //other properties } But I don't want to return the Regions ICollection.
The object can then be returned using something like
Newtonsoft.Json.JsonConvert.SerializeObject()
Am I best returning my own serialised POCO object in this manner ?