public ConcurrencyRepositoryViolationException(string message, UpdateException exception)
     : base(message, exception)
 {
     if (exception.StateEntries != null)
     {
         var entry = exception.StateEntries.FirstOrDefault();
         if (entry != null)
             this.Entity = entry.Entity;
     }
 }
        /// <summary>
        ///     Initializes a new instance of the <see cref = "DbUpdateException" /> class.
        /// </summary>
        /// <param name = "internalContext">The internal context.</param>
        /// <param name = "innerException">The inner exception.</param>
        internal DbUpdateException(
            InternalContext internalContext, UpdateException innerException, bool involvesIndependentAssociations)
            : base(
                involvesIndependentAssociations
                    ? Strings.DbContext_IndependentAssociationUpdateException
                    : innerException.Message,
                innerException)
        {
            _internalContext = internalContext;
            _state.InvolvesIndependentAssociations = involvesIndependentAssociations;

            SubscribeToSerializeObjectState();
        }
Пример #3
0
 ////////////////////////////////////////////////////////////////////////
 //
 // EntityUtil.cs
 //
 internal static UpdateException Update(string message, Exception innerException)
 {
     var e = new UpdateException(message, innerException);
     return e;
 }
 public ConcurrencyRepositoryViolationException(UpdateException exception)
     : this(string.Empty, exception)
 {
 }
 public RepositoryUpdateException(UpdateException exception)
     : this(string.Empty, exception)
 {
 }