{"description":"\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u95a2\u6570\u3067\u306fenum\u578b\u306f\u901a\u5e38\u306e\u65b9\u6cd5\uff08(int)...\uff09\u3067\u6574\u6570\u3078\u5909\u63db\u3067\u304d\u307e\u305b\u3093\u3002 Convert.ToInt32\u3084Convert.ToUInt32\u7b49\u3092\u4f7f\u3048\u3070\u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u95a2\u6570\u3067\u3082enum\u578b\u3092\u6574\u6570\u3078\u5909\u63db\u3067\u304d\u307e\u3059\u3002 using System; Console.WriteLine(f(Enum1.A)); string f<T>(T t) where T : Enum { // \u30b3\u30e1\u30f3\u30c8\u89e3\u9664\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002 // \u30a8\u30e9\u30fc CS0030 \u578b 'T' \u3092 'uint' \u306b\u5909\u63db\u3067\u304d\u307e\u305b\u3093 //return $\"{t} ({(uint)t})\"; return $\"{t} ({Conve\u2026","image_url":null,"categories":["C#"],"type":"rich","published":"2023-01-02 01:31:48","provider_url":"https://hatena.blog","version":"1.0","height":"190","title":"C# \u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u95a2\u6570\u3067Enum\u578b\u3092\u6574\u6570\u3078\u5909\u63db\u3059\u308b","author_url":"https://blog.hatena.ne.jp/potisan/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2023%2F01%2F02%2F013148\" title=\"C# \u30b8\u30a7\u30cd\u30ea\u30c3\u30af\u95a2\u6570\u3067Enum\u578b\u3092\u6574\u6570\u3078\u5909\u63db\u3059\u308b - potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","width":"100%","blog_title":"potisan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e1\u30e2","author_name":"potisan","url":"https://potisan-programming-memo.hatenablog.jp/entry/2023/01/02/013148","blog_url":"https://potisan-programming-memo.hatenablog.jp/"}