diff options
author | crupest <crupest@outlook.com> | 2021-01-07 16:36:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 16:36:57 +0800 |
commit | d3c9d0a9335ac6df3e330172b1b1a8a219cbdbaf (patch) | |
tree | bb99d1a24fffc9c4142219b9c25dc66e3d2b60d2 /BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs | |
parent | 79b597f5163619f8620e60c02e3ff33894ac29d4 (diff) | |
parent | 7594a16e38304739487b053405153379faee6e58 (diff) | |
download | timeline-d3c9d0a9335ac6df3e330172b1b1a8a219cbdbaf.tar.gz timeline-d3c9d0a9335ac6df3e330172b1b1a8a219cbdbaf.tar.bz2 timeline-d3c9d0a9335ac6df3e330172b1b1a8a219cbdbaf.zip |
Merge pull request #198 from crupest/back-dev
Refactor back end.
Diffstat (limited to 'BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs')
-rw-r--r-- | BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs b/BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs index f95dd410..2a7b5b28 100644 --- a/BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs +++ b/BackEnd/Timeline/Services/Exceptions/TimelinePostNotExistException.cs @@ -14,16 +14,21 @@ namespace Timeline.Services.Exceptions protected TimelinePostNotExistException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
+ public TimelinePostNotExistException(long? timelineId, long? postId, bool isDelete, string? message = null, Exception? inner = null)
+ : base(EntityNames.TimelinePost, null, MakeMessage(timelineId, postId, isDelete).AppendAdditionalMessage(message), inner)
+ {
+ TimelineId = timelineId;
+ PostId = postId;
+ IsDelete = isDelete;
+ }
- public TimelinePostNotExistException(string? timelineName, long? id, bool isDelete, string? message = null, Exception? inner = null) : base(EntityNames.TimelinePost, null, MakeMessage(timelineName, id, isDelete).AppendAdditionalMessage(message), inner) { TimelineName = timelineName; Id = id; IsDelete = isDelete; }
-
- private static string MakeMessage(string? timelineName, long? id, bool isDelete)
+ private static string MakeMessage(long? timelineId, long? postId, bool isDelete)
{
- return string.Format(CultureInfo.InvariantCulture, isDelete ? Resources.Services.Exceptions.TimelinePostNotExistExceptionDeleted : Resources.Services.Exceptions.TimelinePostNotExistException, timelineName ?? "", id);
+ return string.Format(CultureInfo.InvariantCulture, isDelete ? Resources.Services.Exceptions.TimelinePostNotExistExceptionDeleted : Resources.Services.Exceptions.TimelinePostNotExistException, timelineId, postId);
}
- public string? TimelineName { get; set; }
- public long? Id { get; set; }
+ public long? TimelineId { get; set; }
+ public long? PostId { get; set; }
/// <summary>
/// True if the post is deleted. False if the post does not exist at all.
|