Respond to PR feedback.
Small variable rename.
This commit is contained in:
parent
633b56e448
commit
85a737c223
2 changed files with 9 additions and 6 deletions
|
@ -11,7 +11,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Models
|
||||||
|
|
||||||
private readonly string _metadataValue;
|
private readonly string _metadataValue;
|
||||||
private readonly Func<T, string> _metadataValueFunc;
|
private readonly Func<T, string> _metadataValueFunc;
|
||||||
private readonly Func<T, bool> _writeMetadataFunc;
|
private readonly Func<T, bool> _writeMetadataConditionFunc;
|
||||||
|
|
||||||
public ItemMetadataValue(string metadataName, string metadataValue)
|
public ItemMetadataValue(string metadataName, string metadataValue)
|
||||||
{
|
{
|
||||||
|
@ -19,16 +19,16 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Models
|
||||||
_metadataValue = metadataValue;
|
_metadataValue = metadataValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemMetadataValue(string metadataName, Func<T, string> metadataValueFunc, Func<T, bool> writeMetadataFunc = null)
|
public ItemMetadataValue(string metadataName, Func<T, string> metadataValueFunc, Func<T, bool> writeMetadataConditionFunc = null)
|
||||||
{
|
{
|
||||||
MetadataName = metadataName;
|
MetadataName = metadataName;
|
||||||
_metadataValueFunc = metadataValueFunc;
|
_metadataValueFunc = metadataValueFunc;
|
||||||
_writeMetadataFunc = writeMetadataFunc;
|
_writeMetadataConditionFunc = writeMetadataConditionFunc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShouldWriteMetadata(T source)
|
public bool ShouldWriteMetadata(T source)
|
||||||
{
|
{
|
||||||
return _writeMetadataFunc == null || _writeMetadataFunc(source);
|
return _writeMetadataConditionFunc == null || _writeMetadataConditionFunc(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetMetadataValue(T source)
|
public string GetMetadataValue(T source)
|
||||||
|
|
|
@ -82,9 +82,12 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddItemTransform<T> WithMetadata(string metadataName, Func<T, string> metadataValueFunc, Func<T, bool> writeMetadataFunc = null)
|
public AddItemTransform<T> WithMetadata(
|
||||||
|
string metadataName,
|
||||||
|
Func<T, string> metadataValueFunc,
|
||||||
|
Func<T, bool> writeMetadataConditionFunc = null)
|
||||||
{
|
{
|
||||||
_metadata.Add(new ItemMetadataValue<T>(metadataName, metadataValueFunc, writeMetadataFunc));
|
_metadata.Add(new ItemMetadataValue<T>(metadataName, metadataValueFunc, writeMetadataConditionFunc));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue