tdykstra / contosouniversityefcore Goto Github PK
View Code? Open in Web Editor NEWVS2015 EF MVC Core tutorials, plus code results of following the VS2017 tutorials, one branch for each tutorial stage.
VS2015 EF MVC Core tutorials, plus code results of following the VS2017 tutorials, one branch for each tutorial stage.
Hi,
I followed this very educational tutorial: Creating a complex data model - EF Core with ASP.NET Core MVC tutorial (5 of 10).
https://docs.microsoft.com/et-ee/aspnet/core/data/ef-mvc/complex-data-model
After running the command "dotnet ef database update" at CLI, I am getting an error: "There is already an object named 'Course' in the database", (see below).
The app is working until then, but when I want to change column attributes as described in paragraph "The Column attribute", I am getting an error form browser: :SqlException: Invalid column name 'FirstName'. System.Data.SqlClient.SqlCommand+<>c.b__107_0(Task result).
I would like to learn more. Thanks in advance!
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\User\Documents\visual studio 2017\Projects\ContosoUniversity\ContosoUni
versity>dotnet ef database update
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:07.21
System.Data.SqlClient.SqlException: There is already an object named 'Course' in the database.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj ect 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, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSou rce
1 completion, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite, String
methodName)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(I
RelationalConnection connection, String executeMethod, IReadOnlyDictionary2 par ameterValues, Boolean closeConnection) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNo nQuery(IRelationalConnection connection, IReadOnlyDictionary
2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor
.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connecti
on)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String
targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateD
atabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c_
_DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execu
te(Action action)
ClientConnectionId:b1bd24a3-87e2-4d93-b1c1-006b37c31f53
Error Number:2714,State:6,Class:16
There is already an object named 'Course' in the database.
-----------------------------------------------------------------------------**
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.