Exemplo n.º 1
0
        public void AddGetWithDetailsMethod(string className, DbTable table, DbTable detailsTable)
        {
            _buffer.AppendLine(string.Format(@"public List<{0}> GetAll()", className));

            this.BeginBlock();

            _buffer.AppendLine(string.Format(@"var query = @""{0}"";", QueryCreator.GetSelect(table, detailsTable).Statement));
            this.AddEmptyLine();
            _buffer.AppendLine(@"return QueryHelper.Get(query, this.IdReader, this.Creator, _adapter.Creator, this.Attach);");

            this.EndBlock();
        }
Exemplo n.º 2
0
        public void AddFillMethod(string className, DbTable table)
        {
            var name = NameProvider.ToParameterName(table.Name);

            _buffer.AppendLine(string.Format(@"public void Fill({0} {1})", GetDictionaryField(className), name));

            this.BeginBlock();

            _buffer.AppendLine(this.GetParameterCheck(name));
            this.AddEmptyLine();
            _buffer.AppendLine(string.Format(@"var query = @""{0}"";", QueryCreator.GetSelect(table).Statement));
            this.AddEmptyLine();
            _buffer.AppendLine(string.Format(@"QueryHelper.Fill({0}, query, this.Creator, this.Selector);", name));

            this.EndBlock();
        }