Beispiel #1
0
 public void AddError(string message, LookUps.ErrorType errorType, string propertyName = "")
 {
     ErrorsList.Add(new Error
     {
         Message      = message,
         PropertyName = propertyName,
         ErrorType    = errorType
     });
 }
Beispiel #2
0
        protected void HandleError(BaseModel baseModel = null, LookUps.ErrorType errorType = LookUps.ErrorType.Exception, Exception ex = null, string message = null, string propertyType = "")
        {
            if (baseModel != null)
            {
                if (ex != null)
                {
                    baseModel.AddError(ex.Message, errorType, propertyType);
                }
                else
                {
                    baseModel.AddError(message, errorType, propertyType);
                }
            }

            if (ex != null)
            {
                contextInfo.ErrorHelper.LogError(ex);
            }
        }