ignore users in Json
This commit is contained in:
parent
b3ccc69ec7
commit
d82792da02
3 changed files with 7 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
|
|
@ -16,7 +17,8 @@ namespace Yavsc.Models
|
||||||
public int Rate { get; set; }
|
public int Rate { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string AuthorId { get; set; }
|
public string AuthorId { get; set; }
|
||||||
[ForeignKey("AuthorId")]
|
|
||||||
|
[ForeignKey("AuthorId"),JsonIgnore]
|
||||||
public ApplicationUser Author { set; get; }
|
public ApplicationUser Author { set; get; }
|
||||||
public bool Visible { get; set; }
|
public bool Visible { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
|
|
@ -12,7 +13,7 @@ namespace Yavsc.Models
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("OwnerId")]
|
[ForeignKey("OwnerId"),JsonIgnore]
|
||||||
public virtual ApplicationUser Owner { get; set; }
|
public virtual ApplicationUser Owner { get; set; }
|
||||||
|
|
||||||
[InverseProperty("Circle")]
|
[InverseProperty("Circle")]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Yavsc.Models
|
namespace Yavsc.Models
|
||||||
{
|
{
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Yavsc.Models
|
||||||
[Required()]
|
[Required()]
|
||||||
public string OwnerId { get; set; }
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
[ForeignKeyAttribute("OwnerId")]
|
[ForeignKeyAttribute("OwnerId"),JsonIgnore]
|
||||||
public virtual ApplicationUser Owner { get; set; }
|
public virtual ApplicationUser Owner { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue