private static unsafe KeyValueStoreItem CreateFromNative(IntPtr nativeItem) { var item = (NativeTypes.FABRIC_KEY_VALUE_STORE_ITEM *)nativeItem; var metadata = KeyValueStoreItemMetadata.CreateFromNative(item->Metadata); var returnValue = new KeyValueStoreItem() { Metadata = metadata, Value = NativeTypes.FromNativeBytes(item->Value, (uint)metadata.ValueSizeInBytes) }; return(returnValue); }
internal static KeyValueStoreNotification CreateFromNative(NativeRuntime.IFabricKeyValueStoreNotification nativeNotification) { var returnValue = new KeyValueStoreNotification() { IsDelete = NativeTypes.FromBOOLEAN(nativeNotification.IsDelete()) }; returnValue.kvsItem = KeyValueStoreItem.CreateFromNative(nativeNotification); GC.KeepAlive(nativeNotification); return(returnValue); }