diff --git a/cpp/Platform.Data.Tests/ILinksTests.cpp b/cpp/Platform.Data.Tests/ILinksTests.cpp index 99159b5..80af94a 100644 --- a/cpp/Platform.Data.Tests/ILinksTests.cpp +++ b/cpp/Platform.Data.Tests/ILinksTests.cpp @@ -31,6 +31,7 @@ namespace Platform::Data::Tests const TLinkAddress linkAddress {1}; Create(storage, linkAddress); Update(storage, TLink{1}, TLink{1, 1}); + Update(storage, TLink{1, 1}, linkAddress); // Test new variadic Update method storage.Count(TLink{1}); const_links.Count(TLink{1}); storage.Each(TLink{1}, [](const TLink& link){ return 1; }); diff --git a/cpp/Platform.Data/ILinksExtensions.h b/cpp/Platform.Data/ILinksExtensions.h index eda9516..a0540dd 100644 --- a/cpp/Platform.Data/ILinksExtensions.h +++ b/cpp/Platform.Data/ILinksExtensions.h @@ -89,6 +89,13 @@ typename TStorage::LinkType restrictionContainer { static_cast(restriction)... }; return DIRECT_METHOD_CALL(TStorage, storage, Each, restrictionContainer, handler); } + + template + static typename TStorage::LinkAddressType Update(TStorage& storage, const typename TStorage::LinkType& substitution, std::convertible_to auto... restrictions) + { + typename TStorage::LinkType restrictionContainer { static_cast(restrictions)... }; + return Update(storage, restrictionContainer, substitution); + } template static typename TStorage::LinkType GetLink(const TStorage& storage, typename TStorage::LinkAddressType linkAddress)