I'm trying to retain the selected value of a dropdownlist once the user change the dropdownlist item but its not working as expected what I wanted is to retain the selected item in the dropdownlist but its it defaulted to the `Select Company` everytime i select the item from dropdownlist, once the user change it postback the page (i know there is no postback in the MVC)

What I'm doing wrong here?

```
<div class="form-group">
   @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { @id = "form_dropdown" }))
   {
      @Html.DropDownListFor(m => m.ListOfCompanies, 
      new SelectList((System.Collections.IEnumerable)Model.ListOfCompanies, "Value", "Text"), 
      "Select Company", new { @class = "form-control", Name = "sel" })
  } 

```

```
[HttpPost]
public ActionResult Index(string sel)
{
   var vModel = new EmployeeViewModel();
   vModel = _db.GetEmployee.ToList();

   //load list of companies:

   var company =   _db.LoadComapny.ToList();          
   IEnumerable<SelectListItem> result = model.Select(b => new SelectListItem
   {
       Value = b.Value,
       Text = b.Text,
       Selected = b.Text == sel
   }).ToList(); 

   vModel.ListOfCompanies = company;
   vModel.SELECTED_COMPANY = sel;

   return View(vModel);
}

```

Model:

```
public class EmployeeViewModel
{
   public IEnumerable<SelectListItem> ListOfCompanies { get; set; }
   public string SELECTED_COMPANY { get; set; }
   //other props
}

```
['https://Stackoverflow.com/questions/31441040', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/275390/']
As I wrote in the comment section, it's really unclear to me what you're asking.
However, looking at your code examples, it seems to me that `trait A` isn't really required.
You can use the types that already come with the Scala SDK:

```
object B extends (()=>Unit) {
  def apply() { /* implementation */ }
}

```

Or, as a variant:

```
object B {
  val aType:()=>Unit = {() => /* implementation */ }
}

```

In the first case, you can access the singleton instance with `B`, in the second case with `B.aType`.
In the second case, no explicit declaration of the `apply` method is needed.

Pick what you like.
The essential message is: You don't need a trait if you just define one simple method.
That's what Scala functions are for.

The list type might look like this:

```
private val aList:ListBuffer[()=>Unit] = ???

```

(By the way: Why not declare it as `Seq[()=>Unit]`? Is it important to the caller that it is a `ListBuffer` and not some other kind of sequence?)

Your worker might then look like this:

```
abstract class Worker {
  def aType:()=>Unit // no need for the `get` prefix here, or the empty parameter list
  def do() {aType()}
}

```

Note that now the `Worker` type has become a class that offers a method that invokes a function.
So, there is really no need to have a `Worker` class.
You can just take the function (`aType`) directly and invoke it, just so.

If you always want to call the implementation in `object B`, well - just do that then.
There is no need to wrap the call in instances of other types.
Your example class `B` just forwards the call to the `B` object, which is really unnecessary.
There is no need to even create an instance of `B`.
It does have the private member variable `creator`, but since it's never used, it will never be accessed in any way.

So, I would recommend to completely remove the `class B`.
All you need is the type `()=>Unit`, which is exactly what you need: A function that takes no parameters and returns nothing.

If you get tired of writing `()=>Unit` all the time, you can define a type alias, for example inside the package object.
Here is my recommentation:

```
type SideEffect = ()=>Unit

```

Then you can use `SideEffect` as an alias for `()=>Unit`.

That's all I can make of it.
It looks to me that this is probably not what you were looking for.
But maybe this will help you a little bit along the way.
If you want to have a more concrete answer, it would be nice if you would clarify the question.
`object B` doesn't really have much to do with `class B` aside from some special rules.

If you wish to reuse that `doSomething` method you should just reuse the implementation from the object:

```
class B {
  def doSomething() = B.doSomething()
}

```

If you want to specify `object B` as a specific instance of `class B` then you should do the following:

```
object B extends B("some particular creator") {
...
}

```

You also do not need `override` modifiers although they can be handy for compiler checks.