diff --git a/ServiceLayer/PostServices/DetailPostDto.cs b/ServiceLayer/PostServices/DetailPostDto.cs index 005de7b..1f6d160 100644 --- a/ServiceLayer/PostServices/DetailPostDto.cs +++ b/ServiceLayer/PostServices/DetailPostDto.cs @@ -93,7 +93,7 @@ public class DetailPostDto : ILinkToEntity /// public DateTime LastUpdatedUtc { get { return DateTime.SpecifyKind(LastUpdated, DateTimeKind.Utc); } } - public string TagNames { get { return string.Join(", ", Tags.Select(x => x.Name)); } } + public string TagNames { get { return Tags == null ? string.Empty : string.Join(", ", Tags.Select(x => x.Name)); } } //ctor public DetailPostDto() diff --git a/ServiceLayer/PostServices/DetailPostDtoAsync.cs b/ServiceLayer/PostServices/DetailPostDtoAsync.cs index c133b32..bf20784 100644 --- a/ServiceLayer/PostServices/DetailPostDtoAsync.cs +++ b/ServiceLayer/PostServices/DetailPostDtoAsync.cs @@ -92,7 +92,7 @@ public class DetailPostDtoAsync : ILinkToEntity /// public DateTime LastUpdatedUtc { get { return DateTime.SpecifyKind(LastUpdated, DateTimeKind.Utc); } } - public string TagNames { get { return string.Join(", ", Tags.Select(x => x.Name)); } } + public string TagNames { get { return Tags == null ? string.Empty : string.Join(", ", Tags.Select(x => x.Name)); } } //ctor public DetailPostDtoAsync()