Inheritance: DbTableName
Exemplo n.º 1
0
 private static string MakeIdList(DbTable table)
 {
     var re = Options.Do.Conventions;
     return string.Join(", ",
         table.PrimaryKeysExceptFk.Select(x => "{0} {1}".AsFormat(re.TypeFor(x), re.NameFor(x))).Union(
         table.KeyManyToOneRelations.Select(x => "{0} {1}".AsFormat(re.TypeFor(x), re.NameFor(x)))).ToArray());
 }
Exemplo n.º 2
0
 public void Create(DbTable table)
 {
     var conventions = GetConventions();
     var fileName = FileTemplate.AsFormat(conventions.NameFor(table));
     SetTemplate(table);
     if (Overwrite || !Project.ExistsFile(fileName))
         Project.AddNewFile(fileName, FileType, this.ToString());
 }
Exemplo n.º 3
0
        protected override void SetTemplate(Simple.Metadata.DbTable table)
        {
            var opt = Options.Instance;
            var re  = opt.Conventions;

            this.SetMany(new
            {
                re        = re,
                table     = table,
                opt       = opt,
                classname = re.NameFor(table),
                count     = new Func <IEnumerable, int>(x => x.Cast <object>().Count()),
                idlist    = new Func <DbTable, string>(MakeIdList)
            });
        }
Exemplo n.º 4
0
 protected abstract void SetTemplate(DbTable table);