Q:

How to convert List to a Map?

I have a List<custom_object__c>. I want to convert to a Map, where the ID is the String and the value to be an custom_object__c object.
Map<String, WrapperEmployee> mapEmp = new Map<String, WrapperEmployee>();
for(WrapperEmployee emp : WrapperEmployeeList)
{
     mapEmp.put(emp.Name, emp);
}

The problem with the above code is that its only adding the last row, so if I have 10 rows in the WrapperEmployeeList it only addes in the mapEmp the last row from the WrapperEmployeeList.

A:

You begin your question with: 

I have a List. I want to convert to a Map, where the ID is the String and the value to be an custom_object__c object.

Then you show us code that doesn't at all reference List<custom_object__c>. So, like others, I'm a bit confused. To help point you in the right direction, I'm going to give you an answer to the the initial question which you can perhaps adapt to your other code. 
Assuming you have List<custom_object__c>MyList,
map<Id,custom_object__c>MyMap = new map<Id,custom_object__c>(MyList);

The above automatically creates your map with Id and your object. If you need the Id's explicitly as strings (that's actually what they are), you can create a new map from the above by iterating on the keyset() and using string.valueOf(Id).
You'll find the above map constructor and other methods documented here.

