private UpdatePart GetUpdateForEntity(EntityTable mainTable,IEnumerable<PropertyMapping> propGroup)
 {
     var mainTableContext = GetTableContext(mainTable, "M");
     var updatebuilder = new UpdateSqlBuilder(mainTableContext);
     var param = updatebuilder.GetNextParameter();
     updatebuilder.Where(
         updatebuilder.GetEquality(mainTableContext, mainTable.IdentityColumn.ColumnName, param)
         );
     var updatePart = new UpdatePart
     {
         Parameters = {new Parameter {Property = mainTable.IdentityColumn, Name = param}}
     };
     foreach (var prop in propGroup)
     {
         param = updatebuilder.Set(mainTableContext, prop.ColumnName);
         updatePart.Parameters.Add(new Parameter{ Name = param, Property = prop});
     }
     updatePart.SqlString = updatebuilder.GetSql();
     return updatePart;
 }
 private static UpdatePart GetInsertForEntity(EntityTable mainTable, IEnumerable<PropertyMapping> propGroup)
 {
     var insertBuilder = new InsertSqlBuilder(mainTable);
     var updatePart = new UpdatePart();
     if (mainTable.HasDiscriminator)
     {
         propGroup = Enumerable.Repeat(mainTable.DiscriminatorColumn, 1).Concat(propGroup);
     }
     foreach (var prop in propGroup)
     {
         var paramerter = new Parameter()
         {
             Name = insertBuilder.AddInsert(prop.ColumnName),
             Property = prop
         };
         updatePart.Parameters.Add(paramerter);
     }
     updatePart.SqlString = insertBuilder.GetSql();
     return updatePart;
 }