Exemple #1
0
        /// <summary>
        /// Create an ItemVersionedId from this VersionedAddress, masking the ItemVersion with the supplied ItemVersion
        /// </summary>
        /// <param name="mask">The ItemVersion to mask with</param>
        /// <returns>The resulting ItemVersionedId</returns>
        public ItemVersionedId Mask(ItemVersion mask)
        {
            var ivid = new ItemVersionedId(this);

            ivid.Version = ivid.Version.Mask(mask);
            return(ivid);
        }
Exemple #2
0
 /// <inheritdoc/>
 public override bool Set(Address a, object data, Dictionary <string, object> setOptions)
 {
     if (data is TTo)
     {
         ItemVersionedId ivid    = new ItemVersionedId(data);
         var             current = baseCollator.Get <TFrom>(new ItemId[] { WriteConvertVersionedId(ivid) }).FirstOrDefault();
         return(SetInner(a, current, data as TTo, setOptions));
     }
     else
     {
         return(baseCollator.Set(a, data, setOptions));
     }
 }
Exemple #3
0
 /// <inheritdoc/>
 public override void Delete(Address a, object data, bool bypassChecks)
 {
     if (data is TTo)
     {
         ItemVersionedId ivid    = new ItemVersionedId(System, data);
         var             current = baseCollator.Get <TFrom>(new ItemId[] { WriteConvertVersionedId(ivid) }).FirstOrDefault();
         baseCollator.Delete(a, writeConvert(data as TTo, current), bypassChecks);
     }
     else
     {
         baseCollator.Delete(a, data, bypassChecks);
     }
 }
Exemple #4
0
 /// <summary>
 /// Convert an ItemVersionedId for writing to the underlying collator
 /// </summary>
 /// <param name="ivid">The ItemVersionedId</param>
 /// <returns>The converted ItemVersionedId</returns>
 protected virtual ItemVersionedId WriteConvertVersionedId(ItemVersionedId ivid)
 {
     return(new ItemVersionedId(typeof(TFrom), IdWriteConvert(ivid.Id), ivid.Version));
 }