22 lines
695 B
C#
22 lines
695 B
C#
using Knoks.Core.Logic.Interfaces;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Knoks.Core.Logic.Managers
|
|
{
|
|
|
|
public class ValidationException : Exception, IValidationException
|
|
{
|
|
public ValidationException(string message, IDictionary<string, string> errors) : base(message)
|
|
{
|
|
this.Errors = errors;
|
|
}
|
|
public ValidationException(string property, string message, string commonMessage = null) : base(commonMessage ?? message)
|
|
{
|
|
this.Errors = new Dictionary<string, string>() { { property, message } };
|
|
}
|
|
public IDictionary<string, string> Errors { get; private set; }
|
|
}
|
|
}
|