C# MVC .net is Nice

PDFPrintE-mail
14Sep2012
Last Updated on 14 September 2012 | Written by CodeAsm

I am working on an blog code in MVC and I must say, I like it. Why do I keep on using Php?
ALso I like to know if its posible to run MVC C# with .net on a Linux pc.

Some helpful websites:
http://blogs.msdn.com/b/stuartleeks/archive/2010/05/21/asp-net-mvc-creating-a-dropdownlist-helper-for-enums.aspx

http://blog.bennymichielsen.be/2011/05/21/entity-framework-4-1-supporting-enums/

and The next code is the example i was working on:

http://msdn.microsoft.com/en-US/data/jj591621

This is something i got today, it work :P after some editing and removing:

PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Applying code-based migrations: [201209141508585_AddColor].
Applying code-based migration: 201209141508585_AddColor.
System.Data.SqlClient.SqlException (0x80131904): Column names in each table must be unique. Column name 'FavoriteColor' in table 'dbo.Blogs' is specified more than once.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Migrations.DbMigrator.ExecuteSql(DbTransaction transaction, MigrationStatement migrationStatement)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ExecuteSql(DbTransaction transaction, MigrationStatement migrationStatement)
at System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable`1 migrationStatements)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.ExecuteStatements(IEnumerable`1 migrationStatements)
at System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String migrationId, XDocument targetModel, IEnumerable`1 operations, Boolean downgrading, Boolean auto)
at System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ApplyMigration(DbMigration migration, DbMigration lastMigration)
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore()
at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
ClientConnectionId:d409dd5d-7262-4e16-84eb-73fd055b9474
Column names in each table must be unique. Column name 'FavoriteColor' in table 'dbo.Blogs' is specified more than once.
PM> Update-Database –TargetMigration: AddPostClass
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Reverting migrations: [201209141506262_dw].
Reverting automatic migration: 201209141506262_dw.
Automatic migration was not applied because it would result in data loss.
PM> Update-Database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Applying code-based migrations: [201209131412100_InitialCreate, 201209131415289_AddBlogUrl, 201209131423385_AddPostClass, 201209141508585_AddColor].
Applying code-based migration: 201209131412100_InitialCreate.
Applying code-based migration: 201209131415289_AddBlogUrl.
Applying code-based migration: 201209131423385_AddPostClass.
Applying code-based migration: 201209141508585_AddColor.
Running Seed method.
PM>