예제 #1
0
        public static void RecordComplexOriginalValues(String parentPropertyName, AddressInfo complexObject, ObjectChangeTracker changeTracker)
        {
            if (String.IsNullOrEmpty(parentPropertyName))
            {
                throw new ArgumentException("String parameter cannot be null or empty.", "parentPropertyName");
            }

            if (changeTracker == null)
            {
                throw new ArgumentNullException("changeTracker");
            }
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.Address", parentPropertyName), complexObject == null ? null : (object)complexObject.Address);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.City", parentPropertyName), complexObject == null ? null : (object)complexObject.City);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.ZipCode", parentPropertyName), complexObject == null ? null : (object)complexObject.ZipCode);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.Country", parentPropertyName), complexObject == null ? null : (object)complexObject.Country);
        }
예제 #2
0
        public static void RecordComplexOriginalValues(String parentPropertyName, TopOrder complexObject, ObjectChangeTracker changeTracker)
        {
            if (String.IsNullOrEmpty(parentPropertyName))
            {
                throw new ArgumentException("String parameter cannot be null or empty.", "parentPropertyName");
            }

            if (changeTracker == null)
            {
                throw new ArgumentNullException("changeTracker");
            }
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.Name", parentPropertyName), complexObject == null ? null : (object)complexObject.Name);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.OrderId", parentPropertyName), complexObject == null ? null : (object)complexObject.OrderId);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.OrderDate", parentPropertyName), complexObject == null ? null : (object)complexObject.OrderDate);
            changeTracker.RecordOriginalValue(String.Format(CultureInfo.InvariantCulture, "{0}.total", parentPropertyName), complexObject == null ? null : (object)complexObject.total);
        }