コード例 #1
0
        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;
        }
コード例 #2
0
        // 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;
        }