Example #1
0
        public Dictionary <string, string> GetService(Dictionary <string, List <Columns> > dict)
        {
            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (var tablename in dict.Keys)
            {
                List <Columns> columns = dict[tablename];
                TService       model   = new TService()
                {
                    ClassName      = GetCSharpNameFromSqlName(tablename),
                    Columns        = columns,
                    PkColumns      = columns.Where(p => p.PK).ToList(),
                    OtherColumns   = columns.Where(p => !p.PK).ToList(),
                    ModelSpaceName = "Mx",
                    Namespace      = baseClassNamespaces + ".Service",
                    TableName      = tablename,
                    ShareNamespace = "MXWater",
                    JsonName       = GetJsonNameFromSqlName(tablename),
                };

                string content = model.TransformText();

                result.Add(model.ClassName + "Service", content);
            }
            return(result);
        }