Exemplo n.º 1
0
        /// <summary>
        /// Ajoute une entrée à la pile d'erreur.
        /// </summary>
        /// <param name="clientIdentifier">Identifiant du client.</param>
        /// <param name="entityError">EntityErrorMessage.</param>
        public void AddEntry(string clientIdentifier, EntityErrorMessage entityError)
        {
            if (string.IsNullOrWhiteSpace(clientIdentifier))
            {
                throw new ArgumentNullException("clientIdentifier");
            }

            if (entityError == null)
            {
                throw new ArgumentNullException("entityError");
            }

            _errors.AddEntityError(clientIdentifier, entityError);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add an error for an entity.
        /// </summary>
        /// <param name="key">Identifier of the entity inside the object "collection".</param>
        /// <param name="entityErrorMessage">The entityErrorMessage object.</param>
        public void AddEntityError(string key, EntityErrorMessage entityErrorMessage)
        {
            if (string.IsNullOrWhiteSpace(key))
            {
                throw new ArgumentNullException("key");
            }

            if (entityErrorMessage == null)
            {
                throw new ArgumentNullException("entityErrorMessage");
            }

            _entitiesErrorMessage.Add(key, entityErrorMessage);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new EntityConstraintException from an Entity Error message.
 /// </summary>
 /// <param name="entityErrorMessage">Error Message.</param>
 public EntityConstraintException(EntityErrorMessage entityErrorMessage)
 {
     _fieldErrors = entityErrorMessage;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create an empty entity constraint exception.
 /// </summary>
 public EntityConstraintException()
 {
     _fieldErrors = new EntityErrorMessage();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Error messages for a collection.
 /// </summary>
 /// <param name="key">Client side id.</param>
 /// <param name="entityErrorMessage">Message.</param>
 public EntityCollectionErrorMessage(string key, EntityErrorMessage entityErrorMessage)
 {
     _entitiesErrorMessage = new Dictionary <string, EntityErrorMessage>();
     AddEntityError(key, entityErrorMessage);
 }