ToString() public method

public ToString ( ) : string
return string
Ejemplo n.º 1
0
        public void CanReplaceSimpleValueUsingExpressions()
        {
            var t = new SimpleTemplate("asd${asd}asd$qwe");

            t.SetMany(asd => 123, qwe => 456);

            t.ToString().Should().Be("asd123asd456");
        }
Ejemplo n.º 2
0
        public void CanReplaceSimpleValueUsingAnonymousObject()
        {
            var t = new SimpleTemplate("asd${asd}asd$qwe");

            t.SetMany(new { asd = 123, qwe = 456 });

            t.ToString().Should().Be("asd123asd456");
        }
Ejemplo n.º 3
0
        public void Run()
        {
            var types = GetTypes();

            using (var project = Options.Do.Model.Project)
            {
                foreach (var type in types)
                {
                    var template = new SimpleTemplate(Templates.AutoService);
                    template["interface"] = "I" + type.Type.GetRealClassName();
                    template["service"] = type;
                    template["opt"] = Options.Do;

                    project.AddNewCompile(FilePath(type.Type.GetRealClassName()), template.ToString());
                }
            }
        }
Ejemplo n.º 4
0
        public void Execute()
        {
            var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");
            var filename = string.Format("{0}_{1}.cs", timestamp, Name ?? "Untitled");

            var template = new SimpleTemplate(Templates.NewMigration);
            template["timestamp"] = timestamp;
            template["opt"] = Options.Do;

            using (var project = Options.Do.Database.Project)
            {
                project.AddNewCompile(filename, template.ToString());

                if (OpenIt)
                    Process.Start(project.GetFullPath(filename));
            }
        }
Ejemplo n.º 5
0
        public void Run()
        {
            var types = GetTypes();

            using (var project = Options.Do.Model.Project)
            {
                foreach (var type in types)
                {
                    var entity = type.Type.GetTypeArgumentsFor(typeof(IEntityService<>)).FirstOrDefault();
                    var template = new SimpleTemplate(Templates.AutoDomain);
                    template["entity"] = entity;
                    template["service"] = type;
                    template["opt"] = Options.Do;

                    project.AddNewCompile(FilePath(entity.Name), template.ToString());
                }
            }
        }
Ejemplo n.º 6
0
 public void CanReplaceSimpleValueUsingToString()
 {
     var t = new SimpleTemplate("asd${asd}asd");
     t["asd"] = 123;
     t.ToString().Should().Be("asd123asd");
 }