Help us understand the problem. What is going on with this article?

PowerShellでC#を使おうとしたときの話

powershellでAdd-Typeを使ってC#のコードを読み込もうとしたら「文字列 入力文字列の形式が正しくありません。書式設定のエラーです」って言われた。
C#のコード部分でreturnを使ってたからっぽい。returnしなくても値が受け継がれるのに全然慣れない。

追記
結局return使わなくても弾かれてる。もう誰か助けてくれ
→「使っているC#が新しすぎるのでは?」とのコメントをいただき、Containsを使っていたのをforeachで回してチェックするようにしたら引っかからなくなりました。ありがとうございました。

Helper.cs
        public static void ExistListView(string[] view, bool result)
        {
            // result = view.Contains('DocumentType'); 
            result = false;
            foreach(var v in view){
                if(v == "DocumentType"){
                    result = true;
                }
            }
        }
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away