Esempio n. 1
0
        public static bool HasAll(this ETag etag, IEnumerable <KeyValuePair <string, object> > values)
        {
            if (etag == null || values == null)
            {
                return(false);
            }

            return(values.Any() && values.All(p => Equal(p.Value, etag.GetValue <object>(p.Key))));
        }
Esempio n. 2
0
        public static bool HasRowVersion(this ETag etag, string memberName, byte[] rowVersion)
        {
            if (etag == null || (rowVersion?.Length ?? 0) == 0)
            {
                return(false);
            }

            var value = etag.GetValue <byte[]>(memberName);

            return(value?.SequenceEqual(rowVersion) ?? false);
        }
        public void GetValueShouldReturnExpectedValue()
        {
            // arrange
            var expected = 42;

            // act
            var actual = etag.GetValue<int>( "id" );

            // assert
            Assert.Equal( expected, actual );
        }
Esempio n. 4
0
 public static bool Has <TValue>(this ETag etag, string memberName, TValue value) =>
 etag == null ? false : Equal(value, etag.GetValue <TValue>(memberName));