System.Data.Entity.SqlServer.SqlServerMigrationSqlGenerator.GenerateMakeSystemTable C# (CSharp) Method

GenerateMakeSystemTable() protected method

Generates SQL to mark a table as a system table. Generated SQL should be added using the Statement method.
protected GenerateMakeSystemTable ( System.Data.Entity.Migrations.Model.CreateTableOperation createTableOperation, System.Data.Entity.Migrations.Utilities.IndentedTextWriter writer ) : void
createTableOperation System.Data.Entity.Migrations.Model.CreateTableOperation The table to mark as a system table.
writer System.Data.Entity.Migrations.Utilities.IndentedTextWriter The to write the generated SQL to.
return void
        protected virtual void GenerateMakeSystemTable(CreateTableOperation createTableOperation, IndentedTextWriter writer)
        {
            Check.NotNull(createTableOperation, "createTableOperation");
            Check.NotNull(writer, "writer");

            writer.WriteLine("BEGIN TRY");

            writer.Indent++;
            writer.WriteLine("EXECUTE sp_MS_marksystemobject '" + Escape(createTableOperation.Name) + "'");
            writer.Indent--;

            writer.WriteLine("END TRY");
            writer.WriteLine("BEGIN CATCH");
            writer.Write("END CATCH");
        }