aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/EntityAlreadyExistException.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-30 16:52:55 +0800
committercrupest <crupest@outlook.com>2021-04-30 16:52:55 +0800
commita672e10faad434899d81ef9d0d0d5adbbc7841da (patch)
tree33c18e4bdad7384c748cf08be1f0569f9a8af619 /BackEnd/Timeline/Services/EntityAlreadyExistException.cs
parentb87abbb8ed0aa86a808b2f97e4d22b0ee1addd9f (diff)
downloadtimeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.tar.gz
timeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.tar.bz2
timeline-a672e10faad434899d81ef9d0d0d5adbbc7841da.zip
refactor: ...
Diffstat (limited to 'BackEnd/Timeline/Services/EntityAlreadyExistException.cs')
-rw-r--r--BackEnd/Timeline/Services/EntityAlreadyExistException.cs21
1 files changed, 8 insertions, 13 deletions
diff --git a/BackEnd/Timeline/Services/EntityAlreadyExistException.cs b/BackEnd/Timeline/Services/EntityAlreadyExistException.cs
index 2d3de368..0aaea012 100644
--- a/BackEnd/Timeline/Services/EntityAlreadyExistException.cs
+++ b/BackEnd/Timeline/Services/EntityAlreadyExistException.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
namespace Timeline.Services
{
@@ -9,24 +10,18 @@ namespace Timeline.Services
/// For example, want to create a timeline but a timeline with the same name already exists.
/// </remarks>
[Serializable]
- public class EntityAlreadyExistException : Exception
+ public class EntityAlreadyExistException : EntityException
{
- public EntityAlreadyExistException() : this(null, null, null, null) { }
- public EntityAlreadyExistException(string? entityName) : this(entityName, null, null, null) { }
- public EntityAlreadyExistException(string? entityName, Exception? inner) : this(entityName, null, null, inner) { }
- public EntityAlreadyExistException(string? entityName, object? entity, Exception inner) : this(entityName, entity, null, inner) { }
- public EntityAlreadyExistException(string? entityName, object? entity, string? message, Exception? inner) : base(message ?? Resource.ExceptionEntityAlreadyExist, inner)
+ public EntityAlreadyExistException() : base() { }
+ public EntityAlreadyExistException(string? message) : base(message) { }
+ public EntityAlreadyExistException(string? message, Exception? inner) : base(message, inner) { }
+ public EntityAlreadyExistException(EntityType entityType, IDictionary<string, object> constraints, string? message = null, Exception? inner = null)
+ : base(entityType, constraints, message ?? Resource.ExceptionEntityNotExist, inner)
{
- EntityName = entityName;
- Entity = entity;
- }
+ }
protected EntityAlreadyExistException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
-
- public string? EntityName { get; }
-
- public object? Entity { get; }
}
}