diff options
| author | crupest <crupest@outlook.com> | 2020-07-10 16:10:17 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-07-10 16:10:17 +0800 |
| commit | f93ac5c1b21f9bee827c51955bd831ce0d322aaf (patch) | |
| tree | 05299533101e2120af1bf85e56fa9f7166563924 /Timeline | |
| parent | b347fcf45abdae58352cf07e24ec907e1f77a31a (diff) | |
| download | timeline-f93ac5c1b21f9bee827c51955bd831ce0d322aaf.tar.gz timeline-f93ac5c1b21f9bee827c51955bd831ce0d322aaf.tar.bz2 timeline-f93ac5c1b21f9bee827c51955bd831ce0d322aaf.zip | |
Add unit tests.
Diffstat (limited to 'Timeline')
| -rw-r--r-- | Timeline/Models/Http/Timeline.cs | 3 | ||||
| -rw-r--r-- | Timeline/Models/Timeline.cs | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Timeline/Models/Http/Timeline.cs b/Timeline/Models/Http/Timeline.cs index aad9aa7b..5404d561 100644 --- a/Timeline/Models/Http/Timeline.cs +++ b/Timeline/Models/Http/Timeline.cs @@ -128,8 +128,7 @@ namespace Timeline.Models.Http public TimelineInfoAutoMapperProfile()
{
CreateMap<Timeline, TimelineInfo>().ForMember(u => u._links, opt => opt.MapFrom<TimelineInfoLinksValueResolver>());
- CreateMap<TimelinePost, TimelinePostInfo>().ForMember(p => p.Content, opt => opt.MapFrom<TimelinePostContentResolver>())
- .ForMember(p => p.Deleted, opt => opt.MapFrom((source, dest) => { return source.Content == null; }));
+ CreateMap<TimelinePost, TimelinePostInfo>().ForMember(p => p.Content, opt => opt.MapFrom<TimelinePostContentResolver>());
CreateMap<TimelinePatchRequest, TimelineChangePropertyRequest>();
}
}
diff --git a/Timeline/Models/Timeline.cs b/Timeline/Models/Timeline.cs index b1772fa7..7afb1984 100644 --- a/Timeline/Models/Timeline.cs +++ b/Timeline/Models/Timeline.cs @@ -60,6 +60,7 @@ namespace Timeline.Models public long Id { get; set; }
public ITimelinePostContent? Content { get; set; }
+ public bool Deleted => Content == null;
public DateTime Time { get; set; }
public User Author { get; set; }
public DateTime LastUpdated { get; set; }
|
