Question: I am trying to call a controller action method inside the lambda expression like below.

Here `dtImporteddata` is my `DataTable`

```
public class DepartmentController : Controller
{
      public ActionResult Create(FormCollection collection, int ParentDepartmentID)
    {
       return view();
    }
}

   dtImporteddata.Rows.Cast<DataRow>().Select(r => new DepartmentController().Create(new FormCollection{ 
                {"ParentDepartmentID","57"},
                {"DepartmentPrefix",r["Prefix"].ToString()},
                {"DepartmentID","0"},
                {"IsSpecialDepartment",null},
                {"Description",r["Description"].ToString()},
                {"Name",r["Name"].ToString()},
                {"LocationIDs.$.PackedValue","4;;;"}
             }, 0)).ToList();

```

if i write like above the `Create()` method is getting called perfectly but if i remove `ToList()` then the `Create()` is not getting called.

Answer: 
@Utah\_Dave's solution will work just fine, or you can do the following (which is how I run it).

**Filesystem**:

```
/dev
  Vagrantfile
  salt-minion.conf
  salt/
    top.sls
    my-awesome-state/init.sls
  pillar/
    top.sls
    my-awesome-pillar.sls

```

**Vagrantfile**:

```
Vagrant.configure("2") do |config|
  config.vm.box = "mafro/jessie64-au-salt"

  # salt config directory & shared dir in /tmp
  config.vm.synced_folder ".", "/srv/salt"

  # setup the salt-minion
  config.vm.provision :salt do |salt|
    salt.minion_config = "salt-minion.conf"
  end
end

```

**salt-minion.conf**

```
file_client: local

id: awesome

file_roots:
  base:
    - /srv/salt/salt

pillar_roots:
  base:
    - /srv/salt/pillar

```
Vagrant's implementation of **salt.grains\_config** doesn't copy the file to the **/etc/salt/minion.d** folder as you might expect. Instead it copies the file to **/etc/salt/grains**.

To get the salt-minion to read this new **grains** file, you just need to add the following to your minion configuration:

/etc/salt/minion
================

```
include:
  - /etc/salt/grains

```