Hi,
just a "thing" I would love to do one day... is there a way to validate the database against the entities generated with LLBLGen?
My colleagues often use their own database for testing, and right now they just upgrade the version number stored in the database to keep working when I built a new release.
However, when I modify the database, they only notice it later on... is there a way to check in advance?
public static void ValidateGrid(string objectName, DataGridTableStyle style, bool isDal, string originatingClass)
{
try
{
Type type = ((isDal) ?
s_DALassembly.GetType("Dipica.BM.DAL.EntityClasses." + objectName + "Entity", true, true) :
s_assembly.GetType("Dipica.BM." + objectName, true, true));
foreach (DataGridColumnStyle dgcs in style.GridColumnStyles)
{
PropertyInfo pi = type.GetProperty(dgcs.MappingName);
if (pi == null)
SharedFunctions.MailAndDisplayError(
new SharedFunctions.InvalidParameterException(dgcs.MappingName + " does not exist in " + style.MappingName + " for " + type.Name + " in class " + originatingClass + "!"),
"Helpers.cs", false, false);
}
}
catch (Exception ex)
{
SharedFunctions.MailAndDisplayError(ex, "Helpers.cs - " + originatingClass, false, false);
}
}
The code above I currently use to validate the columns used in a datagrid with the object from our own objectmodel (built upon LLBLGen objects) or from LLBLGen directly (the real DAL).
Do I have to loop through entities for validation and see if all properties of the entity return a value?? Or is there a more global approach?
Thanks,
Koen