Beispiel #1
0
        public EntitiesAndValuesCountsDto GetCounts()
        {
            var counts = new EntitiesAndValuesCountsDto
            {
                Entities = _entities,
                Values   = _values,
            };

            Interlocked.Exchange(ref _entities, 0);
            Interlocked.Exchange(ref _values, 0);

            return(counts);
        }
Beispiel #2
0
        public Task <EntitiesAndValuesCountsDto> GetCountsAsync()
        {
            var counts = new EntitiesAndValuesCountsDto
            {
                Entities = _entities,
                Values   = _values,
            };

            Interlocked.Exchange(ref _entities, 0);
            Interlocked.Exchange(ref _values, 0);

            return(Task.FromResult(counts));
        }