C#のLinqの書き方は、忘れがちで調べているのに時間がかかるので、ブログにサンプルを載せて行こうかと思っていたのですが、インターネットを検索して調査するより。ChatGPTに相談するほうが断然早く答えにたどり着けます。
2つのListから、重複するIDを持つListを抽出するC#ソースコードを書く際、ContainsよりIntersectを使った方が良いと数秒で説明できるエンジニアなんて居ないと思いますが、ChatGPTは数秒で回答してくれました、、、
下記はその際のChatGPTとのやりとりです。
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-1.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-2.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-3.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-4.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-5.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-6.png)
![](https://blog.unikktle.com/wp-content/uploads/2023/04/image-7.png)
コメント