igor-tkachev / bltoolkit

Business Logic Toolkit for .NET
MIT License
297 stars 112 forks source link

MappingSchema Converter not used on insert... #376

Closed jogibear9988 closed 8 years ago

jogibear9988 commented 8 years ago

I've the following Code:

        MappingSchema.Default.SetConverter<SerializableDictionary<string, SerializableDictionary<string, string>>, string>((obj) =>
        {
           if (obj == null)
                return null;
            return StringSerializer.JsonNetSerialize(obj);
        });
        MappingSchema.Default.SetConverter<string, SerializableDictionary<string, SerializableDictionary<string, string>>>((txt) =>
        {
            if (txt == null)
                return null;
            return StringSerializer.JsonNetDeSerialize<SerializableDictionary<string, SerializableDictionary<string, string>>>(txt);
        });

And I have the following Property in my Entity:

    [DataMember]
    [Browsable(false)]
    public virtual SerializableDictionary<string, SerializableDictionary<string, string>> ScriptAssignment { get; set; }

when I now Save via:

DataConnection.Insert(obj)

my Converter is not used on the insert, and "MCC.Utilities.SerializableDictionary2[System.String,MCC.Utilities.SerializableDictionary2[System.String,System.String]]" is written to the DB! But when I read, it used the Converter

jogibear9988 commented 8 years ago

Sorry wrong Repo