Sharepoint - Assign Unique permission to SharePoint 2013 List using Client Side code C#
Ok I figured out, I used the below code:
public static void AddPermission(ClientContext cpx, List list,
string groupName, string permissionName)
{
// Web web = cpx.Web;
// Site site = cpx.Site;
var GRoup1 = cpx.Web.SiteGroups.GetByName(groupName);
var roletypes= cpx.Web.RoleDefinitions.GetByType(RoleType.Contributor);
cpx.ExecuteQuery();
list.BreakRoleInheritance(true, false);
RoleDefinitionBindingCollection collRoleDefinitionBinding =
new RoleDefinitionBindingCollection(cpx);
collRoleDefinitionBinding.Add(roletypes);
list.RoleAssignments.Add(GRoup1, collRoleDefinitionBinding);
cpx.ExecuteQuery();
}