【发布时间】:2015-02-20 21:33:38
【问题描述】:
我正在使用 RedisClientManager 并且我开始 在尝试设置对象时,mscorlib.dll 中发生了“System.StackOverflowException”类型的未处理异常错误
client.Set<ApplicationUser>(user.Id, user);
和用户:
public class ApplicationUser : IdentityUser
{
public string Name { get; set; }
public string Surname { get; set; }
public DateTime? BirthDay { get; set; }
public int BirthPlace { get; set; }
public int TeamId { get; set; }
public int AvatarId { get; set; }
public string Address { get; set; }
public DateTime RegisterationDate { get; set; }
public DateTime CodeSendDate { get; set; }
public string ActivationCode { get; set; }
public string PasswordResetToken { get; set; }
public string FacebookAvatar { get; set; }
public string FacebookId { get; set; }
public bool UseFacebookAvatar { get; set; }
public string IpAddress { get; set; }
public virtual Avatar Avatar { get; set; }
public ApplicationUser()
{
this.Coupons = new HashSet<Coupon>();
}
[JsonIgnore]
public virtual ICollection<Coupon> Coupons { get; set; }
}
序列化ApplicationUser时发生错误,我尝试在ICollection上添加[JsonIgnore],因为嵌套循环,(优惠券包含用户)
我找不到什么问题?
【问题讨论】:
标签: c# asp.net servicestack.redis