Пример #1
0
 /// <summary>
 /// Sets the properties of the <see cref="IDataObject" /> instance.
 /// </summary>
 /// <typeparam name="T">The type of entity.</typeparam>
 /// <param name="etpAdapter">The ETP adapter.</param>
 /// <param name="dataObject">The data object.</param>
 /// <param name="entity">The entity.</param>
 /// <param name="uri">The URI.</param>
 /// <param name="name">The name.</param>
 /// <param name="childCount">The child count.</param>
 /// <param name="lastChanged">The last changed in microseconds.</param>
 /// <param name="compress">if set to <c>true</c> compress the data object.</param>
 public static void SetDataObject <T>(this IEtpAdapter etpAdapter, IDataObject dataObject, T entity, EtpUri uri, string name, int childCount = -1, long lastChanged = 0, bool compress = true)
 {
     if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
     {
         Store11StoreProvider.SetDataObject(dataObject, entity, uri, name, childCount, lastChanged, compress);
     }
     else
     {
         Store12StoreProvider.SetDataObject(dataObject, entity, uri, name, childCount, lastChanged);
     }
 }
Пример #2
0
        /// <summary>
        /// Sets the properties of the <see cref="IDataObject" /> instance.
        /// </summary>
        /// <typeparam name="T">The type of entity.</typeparam>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="dataObject">The data object.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="uri">The URI.</param>
        /// <param name="name">The name.</param>
        /// <param name="childCount">The child count.</param>
        /// <param name="lastChanged">The last changed in microseconds.</param>
        /// <param name="compress">if set to <c>true</c> compress the data object.</param>
        public static void SetDataObject <T>(this IEtpAdapter etpAdapter, IDataObject dataObject, T entity, EtpUri uri, string name, int childCount = -1, long lastChanged = 0, bool compress = true)
        {
            // There's nothing to set if the data object is null
            if (dataObject == null)
            {
                return;
            }

            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                Store11StoreProvider.SetDataObject(dataObject, entity, uri, name, childCount, lastChanged, compress);
            }
            else
            {
                Store12StoreProvider.SetDataObject(dataObject, entity, uri, name, childCount, lastChanged);
            }
        }