AppExemplo.Domain.Cadastro.Service.ClienteService.GetById C# (CSharp) Method

GetById() public method

Recupera um cliente pela a chave (Id)
public GetById ( System.Guid key ) : ClienteEntity
key System.Guid chave (Id)
return ClienteEntity
        public ClienteEntity GetById(Guid key)
        {
            //Aqui não há necessidade de verificar se key é null, pois Guid é ValueType

            var entity = _clienteRepository.GetById(key);


            //Ao pedir um item não existente no repositório, representa um Exception no sistema

            if (entity == null) throw new ArgumentNullException(nameof(entity));


            return entity;
        }
        /// <summary>