using System;
using Quadarax.Foundation.Core.Exceptions;

namespace BO.AppServer.Business.Exceptions
{
    public class DataSizeValidationException : CodeException
    {
        private const string CS_MESSAGE = "Entity '{0}' filed '{1}' maximal length overflow (max. {2}).";
        private const int CN_CODE = 1010;


        public DataSizeValidationException(Type entityType, string fieldName, int max, Exception innerException) : base(CN_CODE, string.Format(CS_MESSAGE,entityType.Name, fieldName, max), innerException)
        {
        }

        public DataSizeValidationException(Type entityType, string fieldName, int max) : base(CN_CODE, string.Format(CS_MESSAGE,entityType.Name, fieldName, max))
        {
        }
    }
}
