Skip to content

Commit

Permalink
Updated SerializationUtil default values.
Browse files Browse the repository at this point in the history
  • Loading branch information
yh.ting authored and yh.ting committed Jul 1, 2021
1 parent e2ece3e commit 0409ce1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Summer.Batch.Common/Util/SerializationUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ public DeserializationBinder(List<string> list)

public List<string> CustomDeserializeList { set; get; }

private static readonly List<string> SummerBatchCore = new List<string>() { "Summer.Batch.Common", "Summer.Batch.Core", "Summer.Batch.Data", "Summer.Batch.Extra", "Summer.Batch.Infrastructure","mscorlib","System" };
private static readonly List<string> SummerBatchCore = new List<string>() { "Summer.Batch.Common", "Summer.Batch.Core", "Summer.Batch.Data", "Summer.Batch.Extra", "Summer.Batch.Infrastructure","mscorlib","System", "Microsoft" };
public override Type BindToType(string assemblyName, string typeName)
{
Type typeToDeserialize = null;
Assembly currentAssembly = Assembly.Load(assemblyName);

//Get List of Class Name
string Name = currentAssembly.GetName().Name;
if (SummerBatchCore.Contains(Name) || (CustomDeserializeList.Count != 0 && CustomDeserializeList.Any(name => Name.StartsWith(name))))
if ((SummerBatchCore.Contains(Name) || SummerBatchCore.Any(name => Name.StartsWith(name))) || (CustomDeserializeList.Count != 0 && CustomDeserializeList.Any(name => Name.StartsWith(name))))
{
//The following line of code returns the type.
typeToDeserialize = Type.GetType(String.Format("{0}, {1}",typeName, Name));
Expand Down

0 comments on commit 0409ce1

Please sign in to comment.