public void AddDefaultModelMapping(string modelName) { BiModelMapping mapping = new BiModelMapping(); foreach (string column in this.Columns) mapping.TableToModel[column] = mapping.ModelToTable[column] = column; this.ModelMappings[modelName] = mapping; }
// TODO: add a way to generate pseudo-columns that are functions on the JObject instead of strings public void AddModelMapping(string modelName, IEnumerable<KeyValuePair<string, string> > modelToColumnMapping) { BiModelMapping mapping = new BiModelMapping(); foreach (KeyValuePair<string, string> pair in modelToColumnMapping) { mapping.TableToModel[pair.Value] = pair.Key; mapping.ModelToTable[pair.Key] = pair.Value; } this.ModelMappings[modelName] = mapping; }