2 lists of the same object. how to stop sharing of values

Hi im creating an inventory system and i have two lists of the same object. one for the player and one is a temporary lost that holds items that the player has walked over.

but whenever i update an item in one list the other list changes aswell. they are both is separate scripts and sepretly named. the only similarity is the object the hold. which is a custom class with multiple variables. i believe they are getting the data form this custom class byreferance is there a way to do this by value? or would i need to create a separate class for this ?

Ok here is some more information

the item class it made up like this

using UnityEngine;
using System.Collections;
[System.Serializable]
public class Item{
	public string ItemName;
	public string ItemDescription;
	public int ItemAmount;
	public Sprite ItemIcon;
	public ItemType itemType;
	public bool Stackable;

	public enum ItemType{
		Resource,
		Consumeable,
		Weapon
	}
		
	public Item(string itemName,string itemDescription,int itemAmount,   Sprite itemIcon, ItemType type, bool stackable){
		ItemName = itemName;
		ItemDescription = itemDescription;
		ItemAmount = itemAmount;
		ItemIcon = itemIcon;
		itemType = type;
		Stackable = stackable;
	}
	public Item(){

	}
}

the lists are made using this

public List<Item> inventory = new List<Item>();

public List<Item> inventoryDB = new List<Item>();

when i try and add to the itemAmount variable from inventory and remove it from inventoryDB they seem to share the variable. not this does not happen if inventory already has that item in it

In C#, class always are saved “by reference”! Is you want to use “by value”, use structs.

As an alternative way, you can add a Constructor to your class (if it does not inherits from MonoBehaviour) to copy the variables from other instance. A pseudo code to understand:

public class MyClass
{
    int myInt;
    float myFloat;

    public MyClass(MyClass instance)
    {
        myInt = instance.myInt;
        myFloat = instance.myFloat;
    }
}

public class MyClassManager
{
    void Initialize()
    {
        List<MyClass> myList = new List<MyClass>();

        // add elements to myList;

        List<MyClass> otherList = new List<MyClass>();

        foreach (var myClass in myList)
        {
            otherList.Add(new MyClass(myClass));
        }
    }
}