Skip to content

Commit

Permalink
INTERNALTOOLS-111 MONGOMAPPER ReflectionUtility.CheckRelations para c…
Browse files Browse the repository at this point in the history
…omprobar nombres de objectos y campos
  • Loading branch information
emiliotorrens committed Dec 15, 2015
1 parent ab78558 commit 7cfc013
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions EtoolTech.MongoDB.Mapper/Core/ReflectionUtility.cs
Expand Up @@ -47,7 +47,7 @@ public static void CheckRelations(Assembly Assembly, string ClassName)
foreach (var relation in relations)
{

Console.WriteLine("CHECKING RELATION {0}", relation.Name);
Console.WriteLine(" CHECKING RELATION {0}", relation.Name);

//Check Local Fields Exists
var localPropertiesNames = type.GetProperties().Select(P => P.Name).ToList();
Expand All @@ -56,7 +56,7 @@ public static void CheckRelations(Assembly Assembly, string ClassName)
if (!localPropertiesNames.Contains(relationFieldName))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("WARNING: field {0} does not exists in {1}", relationFieldName, type.Name);
Console.WriteLine(" WARNING: field {0} does not exists in {1}", relationFieldName, type.Name);
Console.ResetColor();
}
}
Expand All @@ -80,14 +80,16 @@ public static void CheckRelations(Assembly Assembly, string ClassName)
if (!destinationPropertiesNames.Contains(relationFieldName))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("WARNING: field {0} does not exists in {1}", relationFieldName, destinationType.Name);
Console.WriteLine(" WARNING: field {0} does not exists in {1}", relationFieldName, destinationType.Name);
Console.ResetColor();
}
}
}
else
{
Console.WriteLine("WARNING: {0} does not exists in {1}", relation.RelationObjectName, Assembly.FullName);
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(" WARNING: {0} does not exists in {1}", relation.RelationObjectName, Assembly.FullName);
Console.ResetColor();
}
}
}
Expand Down

0 comments on commit 7cfc013

Please sign in to comment.