/// <inheritdoc/>
        public async Task <HiveAdmin> UpdateHiveAdminAsync(int hiveAdminId, UpdateHiveAdminRequest updateRequest)
        {
            DbHiveAdmin[] dbHiveAdmins = await _context.HiveAdmins.Where(x => x.Id == hiveAdminId).ToArrayAsync();

            DbHiveAdmin dbHiveAdmin = dbHiveAdmins.FirstOrDefault() ?? throw new RequestedResourceNotFoundException();

            Mapper.Map(updateRequest, dbHiveAdmin);

            await _context.SaveChangesAsync();

            dbHiveAdmins = await _context.HiveAdmins.Where(x => x.Id == hiveAdminId).ToArrayAsync();

            return(dbHiveAdmins.Select(Mapper.Map <HiveAdmin>).FirstOrDefault());
        }
        /// <inheritdoc/>
        public async Task <HiveAdmin> CreateHiveAdminAsync(UpdateHiveAdminRequest createRequest)
        {
            var dbHiveAdmins = await _context.HiveAdmins.Where(x => x.Name == createRequest.Name).ToArrayAsync();

            if (dbHiveAdmins.Length > 0)
            {
                throw new RequestedResourceHasConflictException();
            }

            var dbHiveAdmin = Mapper.Map <UpdateHiveAdminRequest, DbHiveAdmin>(createRequest);

            _context.HiveAdmins.Add(dbHiveAdmin);

            await _context.SaveChangesAsync();

            return(Mapper.Map <HiveAdmin>(dbHiveAdmin));
        }