コード例 #1
0
        /// <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);
            }
        }
コード例 #2
0
 public TrackableWithJsonPropertyName(ITracksChanges entity, List <string> jsonPropertyNames)
 {
     Entity            = entity;
     JsonPropertyNames = jsonPropertyNames;
 }
コード例 #3
0
ファイル: ITracksChanges.cs プロジェクト: Labradoratory/Fetch
 /// <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));
 }
コード例 #4
0
ファイル: ITracksChanges.cs プロジェクト: Labradoratory/Fetch
 /// <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));
 }
コード例 #5
0
        private bool IsIncluded(ITracksChanges entity, string propertyName)
        {
            HashSet <string> includesForEntity;

            return(_includes.TryGetValue(entity, out includesForEntity) && includesForEntity.Contains(propertyName));
        }