最近見かけたコードで気になったものをまとめてみました string.join キー項目をまとめて クエリなどに投げ込むときなど 例)DBなどからキー項目を.Select()して列挙、クエリのパラメータを一括して作成。 // string.join List<string> list = ["111", "222", "333"]; var str = string.Join(",", list); Console.WriteLine(string.Format("WHERE Id in ({0})",str)); // WHERE Id in (111,222,333) // 引数毎に値を取得 var s = "A=123,B=abcde"; var parmA = ""; var parmB = ""; var dic = s.Split(',') .Select(a => a.Spli
![【C#】最近見かけたコーディングから気になったもの4選](https://cdn-ak-scissors.b.st-hatena.com/image/square/5a18075aa61d332785c28ea23b1ed985aeed7b00/height=288;version=1;width=512/https%3A%2F%2Fres.cloudinary.com%2Fzenn%2Fimage%2Fupload%2Fs--hLvDfPv7--%2Fc_fit%252Cg_north_west%252Cl_text%3Anotosansjp-medium.otf_55%3A%2525E3%252580%252590C%252523%2525E3%252580%252591%2525E6%25259C%252580%2525E8%2525BF%252591%2525E8%2525A6%25258B%2525E3%252581%25258B%2525E3%252581%252591%2525E3%252581%25259F%2525E3%252582%2525B3%2525E3%252583%2525BC%2525E3%252583%252587%2525E3%252582%2525A3%2525E3%252583%2525B3%2525E3%252582%2525B0%2525E3%252581%25258B%2525E3%252582%252589%2525E6%2525B0%252597%2525E3%252581%2525AB%2525E3%252581%2525AA%2525E3%252581%2525A3%2525E3%252581%25259F%2525E3%252582%252582%2525E3%252581%2525AE%2525EF%2525BC%252594%2525E9%252581%2525B8%252Cw_1010%252Cx_90%252Cy_100%2Fg_south_west%252Cl_text%3Anotosansjp-medium.otf_34%3Atomiyama%25252Cmasahiko%252Cx_220%252Cy_108%2Fbo_3px_solid_rgb%3Ad6e3ed%252Cg_south_west%252Ch_90%252Cl_fetch%3AaHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYXZhdGFyL2MzMTI4MzAyMjkuanBlZw%3D%3D%252Cr_20%252Cw_90%252Cx_92%252Cy_102%2Fco_rgb%3A6e7b85%252Cg_south_west%252Cl_text%3Anotosansjp-medium.otf_30%3A%2525E6%2525A0%2525AA%2525E5%2525BC%25258F%2525E4%2525BC%25259A%2525E7%2525A4%2525BE%2525E3%252582%2525B8%2525E3%252583%2525BC%2525E3%252583%252589%252520%2525E3%252583%252586%2525E3%252583%252583%2525E3%252582%2525AF%2525E3%252583%252596%2525E3%252583%2525AD%2525E3%252582%2525B0%252Cx_220%252Cy_160%2Fbo_4px_solid_white%252Cg_south_west%252Ch_50%252Cl_fetch%3AaHR0cHM6Ly9saDMuZ29vZ2xldXNlcmNvbnRlbnQuY29tL2EvQUNnOG9jSXlEYkk1RmFrN0NoQlBCbnVJWWliNkFGS0hSUnk3dUd4aFBDTTVWMFpqOWhmT3NBPXM5Ni1j%252Cr_max%252Cw_50%252Cx_139%252Cy_84%2Fv1627283836%2Fdefault%2Fog-base-w1200-v2.png)