Git Product home page Git Product logo

fastdeepcloner's People

Contributors

1-alentoma avatar adamsitnik avatar asos-tomlonghurst avatar kcragin avatar kvishalv avatar skorunka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fastdeepcloner's Issues

Probable thread safety issue

I keep seeing this exception:

'An item with the same key has already been added. Key: <TYPE OF THE CLASS I'M CLONING>'

at FastDeepCloner.FastDeepClonerCachedItems.Creator(Type type, Boolean validateArgs, Object[] parameters)
at FastDeepCloner.FastDeepClonerSettings.<>c.<.ctor>b__12_0(Type type)
at FastDeepCloner.ReferenceClone.ReferenceTypeClone(Dictionary`2 properties, Type primaryType, Object objectToBeCloned, Object appendToValue)
at FastDeepCloner.ReferenceClone.Clone(Object objectToBeCloned)
at FastDeepCloner.DeepCloner.Clone(Object objectToBeCloned, FieldType fieldType)
at NetSupport.DeepClone[T](T original) in 

of note is that this only consistently happens when two threads are calling

FastDeepCloner.DeepCloner.Clone(value, FastDeepCloner.FieldType.Both);

at the same time. It does not occur every time

Based on the locks inside FastDeepClonerCachedItems I'm assuming the cloner is supposed to be thread safe and this is just a bug?

Or should I should not be using this from multiple threads in parallel?

EDIT: I've been seeing this on 1.3.3, I've just updated to 1.3.5 and going to check if it still occurs

some thing wrong in this example

    public class CBase<TKey>
    {
        public TKey Id { get; set; }
    }


    public class C3 : CBase<int>
    {
        public new int Id { get; set; }
    }

    public class C2 : CBase<int>
    {

        public C3 c3 { get; set; } = new();
    }

    public class C1 : CBase<int>
    {
        public C2 c2 { get; set; } = new();
    }

    public class CloneAndDiffTest : TestBase
    {

        [Fact]
        public void TestClone()
        {
            var org = Fixture.Create<C1>();
            var c1 = FastDeepCloner.DeepCloner.Clone(org);
            var c2 = AnyClone.CloneExtensions.Clone(org);// pst.MapClone();
            var diffs_0 = org.Diff(c1);
            var diffs_1 = org.Diff(c2);
    }
  }

diffs_0 has not some different value

im using AnyDiff to get the different fields

StackOverflowException when deep cloning SwaggerDocsConfig

Howdy!

Turns out I'm getting a genuine System.StackOverflowException when using FastDeepCloner and cloning a Swashbuckle.Application.SwaggerDocsConfig object.

Not sure what debugging info I can give, really.

OS: Windows 10 21H2
Visual Studio Version: 2019 Enterprise
Solution: .NET Framework 4.7.1
FastDeepCloner: 1.3.6

I get a System.ExecutionEngineException when cloning object with internal array of objects

I have an object

    [Serializable]
    [StructLayout(LayoutKind.Sequential, Pack = 0)]

    public class MyClass
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
        public short[] shortsArray= new short[4];
        [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct, SizeConst = 4)]
        public InternalClass[] internals = new InternalClass[4];
    }

That has an array of the following objects:

    [Serializable]
    [StructLayout(LayoutKind.Sequential, Pack = 0)]
    public class InternalClass
    {
        public byte myByte;// = 0;
        public uint myUint1;// = 0;
        public uint myUint2;// = 0;
        public uint myUint3;// = 0;
    }

Using both Clone and CloneDynamic on this class throws System.ExecutionEngineException.

Not suitable for large objects

Did some real-life testing and the old DeepCloner nuget package is much faster, possibly using another technique (IL Emit?). It could also handle ImmutableCollection without crashing.
My benchmark on a complex collection of hierarchical objects (14000 of them):
DeepCloner 6.0 ms
FastDeepCloner 7980.0 ms
(131567% slower)

For small objects, the speed difference is of course negligible, but for large ones, there are better options.

Perhaps their method can be implemented, or this drawback can be mentioned in the readme.

CloneTo seems to behave differently than Clone regarding [FastDeepClonerPrimaryIdentifire] annotations

Thanks for the library, it was the only lib that provided what I needed.
In the case that we have a structure (it might be that it only happens in more complex structures though).

object1.attr1 -> object2
object1.attr2 -> object2

Then it seems that object2 is not cloned with 'Clone' which is perfect and what I would expect.
However, CloneTo seems to create duplicates of object2 in some cases although they have the same PrimariyIdentifire ID
A quick look at the code made me wonder whether there is a typo here:

        internal object CloneTo(object itemToClone, object CloneToItem)
        {
            var identifier = CloneToItem.GetFastDeepClonerIdentifier();
            if (identifier != null && _alreadyCloned.ContainsKey(identifier))
                return _alreadyCloned[identifier];

in the Clone, the itemToClone is used for the identifier while here the 'to item' is used. I might be wrong, just took a quick look at the difference.

Managed Debugging Assistant 'FatalExecutionEngineError' when attempting to clone TreeViewItem

Managed Debugging Assistant 'FatalExecutionEngineError'
Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x7419edb5, on thread 0x5644. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'

Some things shouldn't be cloned

Some objects should not be cloned. I cloned a class that has a property of type System.Type. When the DeepClone method clones that property and you compare the original's property to the clone's property, they do not equal.

Something like this:

public class MyClass
{
    Type MyType { get; set; }
}

Each System.Type representing a given loaded type should effectively be a singleton. For example, there is no such thing as two typeof(System.Int32) unless you are really loading two versions of the same assembly in a different load context, or two different assemblies with the same named type.

I like this library. It was hard to find one that worked well and didn't require default constructors.

Is there a work around for this issue? For now I am cloning and explicitly resetting the clone's property. I think in the case of certain types like System.Type you should just copy the reference allowing ReferenceEquals to be true for those cases.

Copying object with ImageSource type of properties throws exception

Hi. I use this library for creating a snapshot of my view model in WPF app. Currently I have few properties that are of type ImageSource. They are bound to the view via INotifyPropertyChanged interface. I noticed that when creating deep copy of my view model, by grouping all the properties in dictionary <string, object>, where string is property name, and object is the value of the property,

I get the following inner exception:
BitmapMetadata initialization incomplete. | System.Exception {System.InvalidOperationException

Stack trace of inner exception:
at System.Windows.Media.Imaging.BitmapMetadata.EnsureBitmapMetadata()
at System.Windows.Media.Imaging.BitmapMetadata.SetQuery(String query, Object value)
at System.Windows.Media.Imaging.BitmapMetadata.set_Rating(Int32 value)

Complete stack trace:

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at System.Reflection.PropertyInfo.SetValue(Object obj, Object value)
at FastDeepCloner.FastDeepClonerProperty.SetValue(Object o, Object value)
at FastDeepCloner.ReferenceClone.ReferenceTypeClone(Dictionary2 properties, Type primaryType, Object objectToBeCloned, Object appendToValue) at FastDeepCloner.ReferenceClone.Clone(Object objectToBeCloned) at FastDeepCloner.ReferenceClone.ReferenceTypeClone(Dictionary2 properties, Type primaryType, Object objectToBeCloned, Object appendToValue)
at FastDeepCloner.ReferenceClone.Clone(Object objectToBeCloned)
at FastDeepCloner.ReferenceClone.Clone(Object objectToBeCloned)
at FastDeepCloner.DeepCloner.Clone[T](T objectToBeCloned, FieldType fieldType)

Cannot clone System.Uri

Hi, your excellent utility cannot copy "System.Uri" objects.
I tried it in a .net 5 project. No error is reported during the cloning, but the cloned object doesn't contain the desired data.

Clone with values

Is there an option to clone an object including the current values of its properties?

I'm trying to clone an object of anonymous type and FastDeepCloner does the job but the values of the properties are the default and can´t be changed later.

thanks!

Extension for dynamic/ExpandoObject

Hi,
thanks a lot for creating and sharing this library!

I found this cloning library after running into some threading issues while using the DeepCloner nuget package. After digging a while through the DeepCloner code, I decided it would be easier to move on to a different helper class.

After running some tests, I found this helper library for cloning objects.

One thing which I would like to know: Is this library still actively maintained?

I went a little bit through the source code, and also the tests. I had the impression that the unit tests could be extended with some scenarios - I have my own unit test that are testing the basic functionality of the Cloner class. If there is an interest, I could share these tests (or create a PR for them)

Nevertheless, I wanted to share some feedback here:
One thing I noticed is the "missing" (or perhaps intentional left out) support for dynamic objects (in my case, I always have an ExpandoObject). Also, if the object already implements ICloneable, it would be good to use the existing Clone() method instead.

Just wanted to share my "workaround" to support this two features, in case anyone is interested:

public static T Clone<T>(T row) {           
    Type rowType = row.GetType();
    //Support for ICloneable
    if (typeof(ICloneable).IsAssignableFrom(rowType) && !rowType.IsArray) {
        return (T)((ICloneable)row).Clone();
    }
    //FastDeepCloner does not support dynamic/ExpandoObject, so we need to handle it separately
    else if (typeof(IDynamicMetaObjectProvider).IsAssignableFrom(rowType)) {
        var ex = row as ExpandoObject;
        return (T)DeepCopy(ex);
    } else {                
        var result = FastDeepCloner.DeepCloner.Clone(row);
        return (T)result;
    }            
}

static object DeepCopy<T>(T original) {
    var clone = new ExpandoObject();
    
    var _original = (IDictionary<string, object>)original;
    var _clone = (IDictionary<string, object>)clone;

    foreach (var kvp in _original) {
        var valueType = kvp.Value.GetType();
        if (valueType.IsPrimitive || valueType == typeof(string)) {
            _clone.Add(kvp.Key, kvp.Value);
            continue;
        } 
        else if (kvp.Value is ExpandoObject) {
            _clone.Add(kvp.Key, DeepCopy((ExpandoObject)kvp.Value));
        }
        else {
            _clone.Add(kvp.Key, kvp.Value.Clone());

        }
    }

    return clone;
}

KeyNotFoundException

When trying to clone my class, I get the 'System.Collections.Generic.KeyNotFoundException'

This is my clone method:

public Enterprise Clone() {
    return FastDeepCloner.DeepCloner.Clone(this);
}

Anyone can help?

HttpMethod issue

If I have a property public HttpMethod Method { get; set; } then its not set in deep copied instance, is this not supported?

NullReferenceException is thrown by FastDeepCloner in Xamarin.iOS mobile app

Hi,

I used the FastDeepCloner in a Xamarin.Forms mobile app for iOS and Android.
Some time ago the iOS app started crashing. Maybe it is related to the updated version of Xamarin.iOS framework. Or maybe it is related to the updated version of iOS. I don't.
Please note, that the Android app works as expected.

Mobile device: iPhone 7 Plus
iOS version: 13.2

Xamarin.Forms version: 3.2.0.839982
Xamarin.iOS version: 13.2.0.47
Mono version: 6_4_0
iOS SDK: iPhoneOS13.2.sdk

FastDeepCloner version: 1.3.0

The FastDeepCloner call is inside our custom .NET Standard 2.0 library.
The FastDeepCloner call is simple:
var clonedMyObj = FastDeepCloner.DeepCloner.Clone(myObj);

The myObj is a class with the following fields:
{ "Account": { "AccountNumber": "1-10HG5N0", "City": "Masku", "Country": "Finland", "CustomerContacts": null, "Id": "f4db0e33-9be0-41dc-a057-e12061e15554", "IsDeleted": false, "LastUpdated": "2017-08-04T09:03:24+00:00", "ModificationNum": 29, "Name": "Ablemans Oy", "PinX": null, "PinY": null, "PostalCode": "21250", "SiebelId": "1-10HG5N0", "State": null, "StreetAddress": "Härjänkurkuntie 46" }, "AccountId": "f4db0e33-9be0-41dc-a057-e12061e15554", "AccountSiebelId": "1-10HG5N0", "AgreementNo": "", "Attachments": [], "BillingTypeCode": "Time \u0026 Material", "CustomerPurchaseOrder": null, "CustomerPurchaseOrderRequired": true, "CustomerSignatures": [], "DailyInspectionIsSold": false, "Employees": [], "ExpenseTypes": [], "Id": "492f22d2-782b-4080-8776-af89941aa2d4", "InternalComments": null, "IsDeleted": false, "IsExpanded": false, "LastUpdated": "0001-01-01T00:00:00+00:00", "ManliftCode": null, "MarkedToDelete": false, "MarkedToDeleteTimestamp": null, "ModificationNum": 4, "OpenedPlannedDate": "2019-03-10T08:00:00", "OriginalServiceRequestId": null, "OriginalServiceRequestSiebelId": "", "PartStatusCode": null, "Parts": [], "PlanningActivities": [{ "Id": "6f315bd4-812d-4c6d-b5e2-59420697e2f5", "IsDeleted": false, "LastUpdated": "0001-01-01T00:00:00+00:00", "ModificationNum": 0, "ServiceRequestId": "492f22d2-782b-4080-8776-af89941aa2d4", "SiebelId": "1-14ENIQS7", "VisitTime": "2019-03-10T08:00:00" } ], "PrimaryContactId": "f0cd958e-9dcd-41a1-a6ee-f070b4a07830", "PrimaryContactSiebelId": null, "RentalEquipmentCode": null, "Reports": [], "SPCode": "SP23 - On-call service", "SPCodeDisplayLabel": "SP23 - On-call services", "SRDescription": "6648", "SRNumber": "1-87955822102", "SalesCaseSiebelId": null, "ServiceProducts": "On call repairs, MAINMAN Planned Maintenance", "ServiceRequestId": "492f22d2-782b-4080-8776-af89941aa2d4", "SiebelId": "1-14EMMIOM", "Status": "In Progress", "TestWeightsCode": null, "TotalEstimate": 8, "VisitReview": null, "WorkPackageId": null, "Workpackages": [{ "Actions": null, "ActualStartDate": "2020-01-13T20:48:01", "AgreementReportingLevelCode": null, "AssetId": "a24e91e0-6bf2-42f5-8ba3-bd54785a7a7d", "AssetInformation": null, "Components": null, "CreatedManually": true, "Description": "6648", "EstimatedHours": 4, "ExpenseEntries": null, "FieldInstructions": "", "HasCustomerSignature": false, "HasTechSignature": false, "Id": "4c226f2f-bee1-4e15-96b3-6f721a31db08", "IsDeleted": false, "LastUpdated": "0001-01-01T00:00:00+00:00", "Loaded": false, "Measurements": null, "ModificationNum": 3, "OriginalWorkPackageId": null, "OriginalWorkPackageSiebelId": null, "OwnerId": "1-14EIWNH6", "PlannedDate": "2019-03-10T08:00:00", "Readings": null, "ServiceProducts": null, "ServiceRequest": null, "ServiceRequestId": "492f22d2-782b-4080-8776-af89941aa2d4", "SiebelAssetId": "1-11RCLLL", "SiebelId": "1-14ENIPQE", "StatusCode": "In Progress", "Tasks": null, "TimeEntries": null, "WPNumber": "1-14ENIPQE" }, { "Actions": null, "ActualStartDate": null, "AgreementReportingLevelCode": null, "AssetId": "1ab0b022-d415-4e71-ae83-3d7d3425d990", "AssetInformation": null, "Components": null, "CreatedManually": true, "Description": "6648", "EstimatedHours": 4, "ExpenseEntries": null, "FieldInstructions": "", "HasCustomerSignature": false, "HasTechSignature": false, "Id": "9590cb67-5d89-4af5-946b-cdf8b2fc87c2", "IsDeleted": false, "LastUpdated": "0001-01-01T00:00:00+00:00", "Loaded": false, "Measurements": null, "ModificationNum": 0, "OriginalWorkPackageId": null, "OriginalWorkPackageSiebelId": null, "OwnerId": "", "PlannedDate": "2019-03-10T08:00:00", "Readings": null, "ServiceProducts": null, "ServiceRequest": null, "ServiceRequestId": "492f22d2-782b-4080-8776-af89941aa2d4", "SiebelAssetId": "1-11OJR9E", "SiebelId": "1-14ENIKB3", "StatusCode": "Unscheduled", "Tasks": null, "TimeEntries": null, "WPNumber": "1-14ENIKB3" } ] }

And the exception is:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object at FastDeepCloner.FastDeepClonerProperty..ctor (System.Reflection.PropertyInfo property) [0x000cf] in <ce0c03c57cf64fd38756e8b69a104181>:0 at FastDeepCloner.FastDeepClonerCachedItems+<>c__DisplayClass28_0.<GetFastDeepClonerProperties>b__2 (System.Reflection.PropertyInfo x) [0x0000c] in <ce0c03c57cf64fd38756e8b69a104181>:0 at System.Linq.Enumerable+WhereArrayIterator1[TSource].ToList () [0x00019] in <69f79cbb9a4c4409847837a879ee8812>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x0001f] in <69f79cbb9a4c4409847837a879ee8812>:0 at FastDeepCloner.FastDeepClonerCachedItems.GetFastDeepClonerProperties (System.Type primaryType) [0x000ae] in <ce0c03c57cf64fd38756e8b69a104181>:0 at FastDeepCloner.ClonerShared.Clone (System.Object objectToBeCloned) [0x00134] in <ce0c03c57cf64fd38756e8b69a104181>:0 at FastDeepCloner.ClonerShared.ReferenceTypeClone (System.Collections.Generic.Dictionary2[TKey,TValue] properties, System.Type primaryType, System.Object objectToBeCloned, System.Object appendToValue) [0x000af] in :0
at FastDeepCloner.ClonerShared.Clone (System.Object objectToBeCloned) [0x00356] in :0
at FastDeepCloner.DeepCloner.Clone[T] (T objectToBeCloned, FastDeepCloner.FieldType fieldType) [0x00006] in :0
at KC.Mobility.Technician.PageModels.ServiceRequest.ServiceRequestsPageModel+<>c.<get_GroupedList>b__42_3 (KC.Mobility.Technician.DataModel.PlanningActivity act, KC.Mobility.Technician.Models.ServiceRequest.ServiceRequestModel sr) [0x00001] in /Users/runner/runners/2.163.1/work/1/s/MobileApp/KC.Mobility.Technician/PageModels/ServiceRequest/ServiceRequestsPageModel.cs:136
at System.Linq.Enumerable+d__814[TOuter,TInner,TKey,TResult].MoveNext () [0x000cb] in <69f79cbb9a4c4409847837a879ee8812>:0 at System.Collections.Generic.List1[T].AddEnumerable (System.Collections.Generic.IEnumerable1[T] enumerable) [0x00059] in <aedd57cfa7174b1b89f01dd6015f4050>:0 at System.Collections.Generic.List1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection) [0x00062] in <aedd57cfa7174b1b89f01dd6015f4050>:0 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in <69f79cbb9a4c4409847837a879ee8812>:0
at KC.Mobility.Technician.PageModels.ServiceRequest.ServiceRequestsPageModel.get_GroupedList () [0x0003d] in /Users/runner/runners/2.163.1/work/1/s/MobileApp/KC.Mobility.Technician/PageModels/ServiceRequest/ServiceRequestsPageModel.cs:133
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00081] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:409
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/corefx/src/Common/src/CoreLib/System/Reflection/MethodBase.cs:53
at Xamarin.Forms.BindingExpression+BindingExpressionPart.TryGetValue (System.Object source, System.Object& value) [0x00049] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:638
at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001ab] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:160
at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
at Xamarin.Forms.BindingExpression+BindingExpressionPart.b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:615
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.47/src/Xamarin.iOS/Foundation/NSAction.cs:152
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.47/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.2.0.47/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at KC.Mobility.Technician.iOS.Application.Main (System.String[] args) [0x00001] in /Users/runner/runners/2.163.1/work/1/s/MobileApp/Mobile Clients/KC.Mobility.Technician.iOS/Main.cs:18
`

Could you tell me please, what is the issue and can I fix it?
Thank you in advance!

Best Regards,
Aleksandrs

cloneTo decimal? error

public class a
{
public virtual decimal? Money { get; set; } = 6;
}

public class b
{
public virtual decimal? Money { get; set; };
}

var user = new a() ;
var cloneTo =new b();
FastDeepCloner.DeepCloner.CloneTo(user, cloneTo);

Because "#if !NETSTANDARD1_3" FastDeepClonerCachedItems.Culture is not initialization

static FastDeepClonerCachedItems()
{
try
{
#if !NETSTANDARD1_3
if (Culture != null && System.Threading.Thread.CurrentThread.CurrentCulture.Name != Culture.Name) // vi behöver sätta det första gången bara. detta snabbar upp applikationen ta inte bort detta.
System.Threading.Thread.CurrentThread.CurrentCulture = Culture;
#else
Culture = new CultureInfo("en");
#endif
}
catch
{
Culture = new CultureInfo("en");
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.