5
I would like to add one more condition to my ternary operator. Is more than two conditions possible? Or is there another possibility?
I need to enter the property Productocatalogodigital which is of type Basicolongdto.
Currently it is this way:
public BasicoLongDTO Produto => ProdutoLivro != null ? new BasicoLongDTO(ProdutoSolucao.Codigo, ProdutoSolucao.Nome) : new BasicoLongDTO(ProdutoBibliotecaDigital.Codigo, ProdutoBibliotecaDigital.Nome);
It worked very well! It stayed this way: Productvro != null ? new Basicolongdto(Productvro.Codigo, Productvro.Name) : Productsrolution != null ? New basicolongdto(Productsproduction.Code, Productsproduction.Name) : Productobibliotecadigital != null ? New basicolongdto(Productobibliotecadigital.Code, Productobibliotecadigital.Name) : new Basicolongdto(Productocatalogodigital.Code, Productocatalogodigital.Name);
– Michele