c # – Divide two elements separated by commas, if they exist


This method divides two items separated by commas, if they exist, and increments the amount if they are already in the list; otherwise add the item to the list

I want to know if this code can be further optimized. Any suggestion?

The method below works 100% but I feel like it is not done well.

private void SeperateJoinedDisposables(IEnumerable joinedDisposables)
{
    if (!joinedDisposables.Any())
        return;

    foreach (var item in joinedDisposables.ToList())
    {
        var amount = item.Amount;
        var container = item.Container;

        var disposable1 = container.Substring(0, container.IndexOf(","));
        var disposable2 = container.Substring(container.IndexOf(",") + 1);

        DisposablesModel.Containers.Remove(item);

        var disposableCointians1 = DisposablesModel.Containers.FirstOrDefault(x => x.Container.ToUpper().Contains(disposable1.ToUpper()));
        var disposableCointians2 = DisposablesModel.Containers.FirstOrDefault(x => x.Container.ToUpper().Contains(disposable2.ToUpper()));

        if (disposableCointians1 != null)
            disposableCointians1.Amount = (int.Parse(disposableCointians1.Amount) + int.Parse(amount)).ToString();
        else
            DisposablesModel.Containers.Add(new Models.Container { Amount = amount, Container = disposable1 });

        if (disposableCointians2 != null)
            disposableCointians2.Amount = (int.Parse(disposableCointians2.Amount) + int.Parse(amount)).ToString();
        else
            DisposablesModel.Containers.Add(new Models.Container { Amount = amount, Container = disposable2 });
    }
}