44using System . Linq ;
55using System . Text . Json . Serialization ;
66
7- namespace Conduit . Domain
7+ namespace Conduit . Domain ;
8+
9+ public class Article
810{
9- public class Article
10- {
11- [ JsonIgnore ]
12- public int ArticleId { get ; set ; }
11+ [ JsonIgnore ]
12+ public int ArticleId { get ; set ; }
1313
14- public string ? Slug { get ; set ; }
14+ public string ? Slug { get ; set ; }
1515
16- public string ? Title { get ; set ; }
16+ public string ? Title { get ; set ; }
1717
18- public string ? Description { get ; set ; }
18+ public string ? Description { get ; set ; }
1919
20- public string ? Body { get ; set ; }
20+ public string ? Body { get ; set ; }
2121
22- public Person ? Author { get ; set ; }
22+ public Person ? Author { get ; set ; }
2323
24- public List < Comment > Comments { get ; set ; } = new ( ) ;
24+ public List < Comment > Comments { get ; set ; } = new ( ) ;
2525
26- [ NotMapped ]
27- public bool Favorited => ArticleFavorites ? . Any ( ) ?? false ;
26+ [ NotMapped ]
27+ public bool Favorited => ArticleFavorites ? . Any ( ) ?? false ;
2828
29- [ NotMapped ]
30- public int FavoritesCount => ArticleFavorites ? . Count ?? 0 ;
29+ [ NotMapped ]
30+ public int FavoritesCount => ArticleFavorites ? . Count ?? 0 ;
3131
32- [ NotMapped ]
33- public List < string > TagList => ArticleTags . Where ( x => x . TagId is not null ) . Select ( x => x . TagId ! ) . ToList ( ) ;
32+ [ NotMapped ]
33+ public List < string > TagList =>
34+ ArticleTags . Where ( x => x . TagId is not null ) . Select ( x => x . TagId ! ) . ToList ( ) ;
3435
35- [ JsonIgnore ]
36- public List < ArticleTag > ArticleTags { get ; set ; } = new ( ) ;
36+ [ JsonIgnore ]
37+ public List < ArticleTag > ArticleTags { get ; set ; } = new ( ) ;
3738
38- [ JsonIgnore ]
39- public List < ArticleFavorite > ArticleFavorites { get ; set ; } = new ( ) ;
39+ [ JsonIgnore ]
40+ public List < ArticleFavorite > ArticleFavorites { get ; set ; } = new ( ) ;
4041
41- public DateTime CreatedAt { get ; set ; }
42+ public DateTime CreatedAt { get ; set ; }
4243
43- public DateTime UpdatedAt { get ; set ; }
44- }
45- }
44+ public DateTime UpdatedAt { get ; set ; }
45+ }
0 commit comments