Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (RequestedBytes != 0L)
            {
                hash ^= RequestedBytes.GetHashCode();
            }
            if (AllocatedBytes != 0L)
            {
                hash ^= AllocatedBytes.GetHashCode();
            }
            if (AllocatorName.Length != 0)
            {
                hash ^= AllocatorName.GetHashCode();
            }
            if (AllocationId != 0L)
            {
                hash ^= AllocationId.GetHashCode();
            }
            if (HasSingleReference != false)
            {
                hash ^= HasSingleReference.GetHashCode();
            }
            if (Ptr != 0UL)
            {
                hash ^= Ptr.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 public async Task <bool> HasAllocationAccess(AllocationId allocationId)
 {
     return(await _readDbContext.Allocations
            .AnyAsync(x => x.AllocationId == allocationId &&
                      _readDbContext.BudgetCategories
                      .Any(s => x.TargetBudgetCategoryId == s.BudgetCategoryId &&
                           _readDbContext.Budgets
                           .Any(b => b.BudgetId == s.BudgetId && b.OwnerUserId == _userContext.UserId))));
 }
Exemplo n.º 3
0
 public override int GetHashCode() {
   int hash = 1;
   if (RequestedBytes != 0L) hash ^= RequestedBytes.GetHashCode();
   if (AllocatedBytes != 0L) hash ^= AllocatedBytes.GetHashCode();
   if (AllocatorName.Length != 0) hash ^= AllocatorName.GetHashCode();
   if (AllocationId != 0L) hash ^= AllocationId.GetHashCode();
   if (HasSingleReference != false) hash ^= HasSingleReference.GetHashCode();
   if (Ptr != 0UL) hash ^= Ptr.GetHashCode();
   return hash;
 }