title: Using static method in asp mvc to use it in different cases
body: <p>I want to khnow if this structure is good if i use it, for example i want to call a method in different controllers (not all) and i don't want to use basecontroller</p>
  
  <h3>Case 1</h3>
  
  <pre><code>public class HomeController : Controller
  {
  public static image GetImage(string url){
  // Get image (not from database)
  }
  }
  </code></pre>
  
  <p>and in userCotroller</p>
  
  <pre><code>public ActionResult index(){
  image img = HomeController.GetImage(//url of image);
  }
  </code></pre>
  
  <h3>Case 2</h3>
  
  <p>Create a class with the static method</p>
  
  <pre><code>public class ForImages
  {
  public static image GetImage(string url){
  // Get image
  }
  </code></pre>
  
  <p>and in userCotroller</p>
  
  <pre><code>public ActionResult index(){
  image img = ForImages.GetImage(//url of image);
  }
  </code></pre>
  
  <h3>Edit</h3>
  
  <p>I want to know if the static method will be executes in every request or will be shared for all requests</p>
  
  <h3>Case 3</h3>
  
  <p>Use the static method from a view</p>
  
  <pre><code>@HomeController.GetImage(//url of image)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>@ForImages.GetImage(//url of image)
  </code></pre>