title: Send Parameter on Remote attribute in MVC
body: <p>Is there a way to send a parameter (not field name) from a <code>Model</code> class to <code>Controller</code> using <code>Remote</code> attribute. </p>
  
  <p>For example, I've this <code>Model</code> class: </p>
  
  <pre><code>public class SubCategory
  {
      [Key]
      public int ID { get; set; }
      public string ClassName
      {
          get { return "SubCategory"; }
      }
      [StringLength(450)]
      [Remote("IsSubCategoryExist", "Products", AdditionalFields = "ID, ClassName",
              ErrorMessage = "Product name already exists")]
      public virtual string Name { get; set; }
      public virtual string ParentName { get; set; }
  }
  </code></pre>
  
  <p>I need to send this class name <code>SubCategory</code> as a parameter to <code>IsSubCategoryExist</code> method in the <code>Products</code> controller when <code>Remote</code> is triggered. Can it be achieved? </p>
  
  <p><b>Update:</b> </p>
  
  <p>Controller code:    </p>
  
  <pre><code>public async Task&lt;JsonResult&gt; IsSubCategoryExist(string Name, int? ID, string ClassName)
  {
        var type = Assembly.GetExecutingAssembly()
                  .GetTypes()
                  .FirstOrDefault(t =&gt; t.Name == ClassName);
  
        if (type != null)
        {
           DbSet dbSet = _dbContext.Set(type);
  
           List&lt;object&gt; subCategories;
           if(ID == null)
           {
               subCategories = await dbSet.Where("Name == @0", Name) 
                                          .Take(1).ToListAsync();
           }
           else
           {
               subCategories = await dbSet.Where("Name == @0 and Id != @1", Name,ID)
                                          .Take(1).ToListAsync();
           }
  
           if(subCategories.Count &gt; 0)
           {
              return Json(false,JsonRequestBehavior.AllowGet);
           }
           return Json(true,JsonRequestBehavior.AllowGet);
       }
       else
       {
          throw new Exception("Table name does not exist with the provided name");
       }
  }
  </code></pre>