diff options
author | crupest <crupest@outlook.com> | 2021-01-07 16:23:20 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-07 16:23:20 +0800 |
commit | df1ef1e21d8d889a2c9abd440039533c6a43818f (patch) | |
tree | c483a2fff48ad952e787e5af1bb541d939a09f19 /BackEnd/Timeline/Services/Exceptions | |
parent | 9470631c67c4740982ff2d8a16cbbb86fdd34609 (diff) | |
download | timeline-df1ef1e21d8d889a2c9abd440039533c6a43818f.tar.gz timeline-df1ef1e21d8d889a2c9abd440039533c6a43818f.tar.bz2 timeline-df1ef1e21d8d889a2c9abd440039533c6a43818f.zip |
史诗级重构!
Diffstat (limited to 'BackEnd/Timeline/Services/Exceptions')
-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.
|