示例#1
0
        private bool TodoCheckDiff(IDiffableResourceHashSet <TodoItem> resources, string checksum)
        {
            var diffPair = resources.GetDiffs().Single();
            var dbCheck  = diffPair.DatabaseValue.Description == checksum;
            var reqCheck = diffPair.Resource.Description == null;

            var updatedRelationship = resources.GetByRelationship <Person>().Single();
            var diffCheck           = updatedRelationship.Key.PublicName == "oneToOnePerson";

            var getAffectedCheck = resources.GetAffected(e => e.OneToOnePerson).Any();

            return(dbCheck && reqCheck && diffCheck && getAffectedCheck);
        }
        private bool TodoCheckDiff(IDiffableResourceHashSet <TodoItem> resources, string checksum)
        {
            ResourceDiffPair <TodoItem> diffPair = resources.GetDiffs().Single();
            bool dbCheck  = diffPair.DatabaseValue.Description == checksum;
            bool reqCheck = diffPair.Resource.Description == null;

            KeyValuePair <RelationshipAttribute, HashSet <TodoItem> > updatedRelationship = resources.GetByRelationship <Person>().Single();
            bool diffCheck = updatedRelationship.Key.PublicName == "oneToOnePerson";

            bool getAffectedCheck = resources.GetAffected(todoItem => todoItem.OneToOnePerson).Any();

            return(dbCheck && reqCheck && diffCheck && getAffectedCheck);
        }