-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't clone dictionary #34
Comments
Here is another example with HashSet. I guess they have the same root cause using System; namespace DeepClonerBug
} |
You need to override
I know this issue but I do not found ways how to correctly bypass it. I can make some hotfixes for |
OK, thank you for your reply. I can make it work with overriding GetHashCode and Equals. Maybe this is not the right place to ask. I want to clone the same object multiple times, is there a way to speed up performance for this case? |
|
Cloning of dictionaries, including read-only, concurrent, sets, ordered and other specializations is fixed in FastCloner. |
Here is a piece of code to recreate the bug, I hope.
using System.Collections.Generic;
using System.Linq;
using Force.DeepCloner;
namespace DeepClonerBug
{
internal class Program
{
static void Main(string[] args)
{
var org = new Dictionary<Location, Location[]>
{
{ new Location { Name = "A" }, new[] { new Location { Name = "1" } } }
};
}
The text was updated successfully, but these errors were encountered: