using Newtonsoft.Json.Serialization;
public static void Main()
var json = JsonConvert.SerializeObject(entity, Formatting.None, new JsonSerializerSettings
ContractResolver = new IgnoreGuidsResolver(),
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
class IgnoreGuidsResolver : DefaultContractResolver
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
JsonProperty prop = base.CreateProperty(member, memberSerialization);
if (prop.PropertyType == typeof(Guid))
public Guid Id { get; set; } public string Name { get; set; } public int Size { get; set; } public Bar Bar { get; set; } public Guid Id { get; set; } public string Name { get; set; } public decimal Amount { get; set; }