/// <summary> /// Include a property /// </summary> /// <param name="entity">The entity to include the property for</param> /// <param name="jsonPropertyNames">The name of the property (in the JSON)</param> public void Include(ITracksChanges entity, IEnumerable <string> jsonPropertyNames) { if (entity == null) { return; } HashSet <string> includesForEntity; if (!_includes.TryGetValue(entity, out includesForEntity)) { includesForEntity = _includes[entity] = new HashSet <string>(); } foreach (var prop in jsonPropertyNames) { includesForEntity.Add(prop); } }
public TrackableWithJsonPropertyName(ITracksChanges entity, List <string> jsonPropertyNames) { Entity = entity; JsonPropertyNames = jsonPropertyNames; }
/// <summary> /// Commits the changes. /// </summary> /// <param name="target">The target.</param> /// <returns>A <see cref="ChangeSet"/> containing the committed changes.</returns> public static ChangeSet CommitChanges(this ITracksChanges target) { return(target.GetChangeSet(ChangePath.Empty, commit: true)); }
/// <summary> /// Commits the changes. /// </summary> /// <param name="target">The target.</param> /// <param name="path">The path the change set represents.</param> /// <returns>A <see cref="ChangeSet"/> containing the committed changes.</returns> public static ChangeSet CommitChanges(this ITracksChanges target, ChangePath path) { return(target.GetChangeSet(path, commit: true)); }
private bool IsIncluded(ITracksChanges entity, string propertyName) { HashSet <string> includesForEntity; return(_includes.TryGetValue(entity, out includesForEntity) && includesForEntity.Contains(propertyName)); }