Exemplo n.º 1
0
 /// <summary>
 /// Creates the mainest item for the data
 /// </summary>
 /// <param name="property"></param>
 private void CreateManifestItem(PropertyInfo property, object dirtyValue, object cleanValue)
 {
     if (!object.Equals(cleanValue, dirtyValue) && cleanValue != null && dirtyValue != null)
     {
         _manifestItem = ManifestBuilder.CreateManifestInfo(property, dirtyValue, cleanValue);
     }
 }
Exemplo n.º 2
0
        public static DocumentManifestInfo AddManifestInfo(PropertyInfo property, ref object dataObject, bool IsDirty = false, DocumentManifestInfo info = null)
        {
            var prop = $"{property.Name}-{property.PropertyType.ToString().Split('.').Last()}";

            if (info == null)
            {
                return(IsDirty ? new DocumentManifestInfo()
                {
                    property = prop, dirtyDataHash = HashValue(property.GetValue(dataObject))
                } :
                       new DocumentManifestInfo()
                {
                    property = prop, cleanDataHash = HashValue(property.GetValue(dataObject))
                });
            }
            else
            {
                if (IsDirty)
                {
                    info.dirtyDataHash = HashValue(property.GetValue(dataObject, null));
                    return(info);
                }
                else
                {
                    info.cleanDataHash = HashValue(property.GetValue(dataObject, null));
                    return(info);
                }
            }
        }