ef-migrations

No connection string named 'ConnectionString' could be found in the application config file (EF parameterless constructor )

∥☆過路亽.° 提交于 2020-06-17 00:50:53
问题 When I create a new Dev Express XAF application using the wizard 20.1.3 for .netcore3.1 the code works fine. I can enable migrations and run a migration without problems. (Or so I thought ... see below) However for certain reasons (my legacy call run-migrations code) I want to provide the connection string location to the constructor When I do this, and try to add a migratiion I get an error The DbContext is set up as using System; using System.Data.Entity; using System.Data.Common; using

No connection string named 'ConnectionString' could be found in the application config file (EF parameterless constructor )

天涯浪子 提交于 2020-06-17 00:49:31
问题 When I create a new Dev Express XAF application using the wizard 20.1.3 for .netcore3.1 the code works fine. I can enable migrations and run a migration without problems. (Or so I thought ... see below) However for certain reasons (my legacy call run-migrations code) I want to provide the connection string location to the constructor When I do this, and try to add a migratiion I get an error The DbContext is set up as using System; using System.Data.Entity; using System.Data.Common; using

Entity Framework Code First Migration

China☆狼群 提交于 2020-05-29 07:46:06
问题 We are using Entity Framework code first migration technique for a while now. Everything works good however our Migrations folder has been growing big with numerous migration files because of changes we are making on entity schema. I was curious, is there a way we can update just one or specific number of files whenever there is change in entity so that our Migrations folder would look less messy. Also, i don't want to drop the table and recreate it since i will be loosing all the saved data.

Entity Framework Code First Migration

徘徊边缘 提交于 2020-05-29 07:46:00
问题 We are using Entity Framework code first migration technique for a while now. Everything works good however our Migrations folder has been growing big with numerous migration files because of changes we are making on entity schema. I was curious, is there a way we can update just one or specific number of files whenever there is change in entity so that our Migrations folder would look less messy. Also, i don't want to drop the table and recreate it since i will be loosing all the saved data.

Visual Studio 2017 using EF Core change local database default location for mdf file before/after migration

时光怂恿深爱的人放手 提交于 2020-05-29 04:37:06
问题 I may need help with the title of my question. So here is more detail. In VS2015 I when creating a database using code first migrations, After completing my first migration I was able to view the database in VS by going to the App_Data folder and clicking on the MDF file. It would then open in Server Explorer. However, in VS2017 I no longer have an App_Data folder and when I did my first migration it took a bit of work to find out where my MDF file was located. If you don't know here are the

'The string argument 'migrationId' cannot be empty.'

别说谁变了你拦得住时间么 提交于 2020-05-24 05:52:45
问题 Blocked on a weird error. I am working in an asp.net core web application, and using EF core 1.1.0 in it. EF database migration is throwing error 'The string argument 'migrationId' cannot be empty.' when trying to execute below command dbcontext.Database.Migrate(); Performed accepted answer from the the link but it did not solved my issue. Uninstall donet 2.0.0, installed 1.1.0 and restarted PC. Still i am getting the same error. Can anyone please help me on this. 回答1: When you have

What might cause SSMS queries to reflect incorrect data and how can we clear the problem?

放肆的年华 提交于 2020-04-30 09:26:12
问题 I have never experienced this before. SSMS is displaying data tables incorrectly. SSMS seems to be locked into some previous query result and I don't see how to clear it. I have an application (MVC) that interfaces to an SQL server. When I run the application's database data delete function, the application shows the table to be empty. But SSMS still shows data in the table. If I then run the application's database seed function, the application shows the table to be re-loaded and I can tell

Cannot list Entity Framework Migrations in Visual Studio 2019 due to dotnet ef dbcontext --json failure

别说谁变了你拦得住时间么 提交于 2020-04-15 21:55:48
问题 I have an ASP.NET Core 3.0 project that uses .NET Core 3.0. I have recently upgraded VS 2019 to version 16.4.1. I use Web Publish from Visual Studio to deploy the application on various environments, but this failed after the upgrade due to EF migrations (trying to find the db contexts failed): dotnet ef dbcontext --json failure Run "dotnet tool restore" to make the "dotnet-ef" command available. I tried to understand what is wrong. dotnet tool restore Cannot find a manifest file. For a list

Create table and insert data into it during EF code first migration

倖福魔咒の 提交于 2020-04-08 02:44:12
问题 I'm using Entity Framework Code First with Code First migrations. During a migration, I need to create a new table, and then insert some data into it. So I create the table with : CreateTable("MySchema.MyNewTable", c => new { MYCOLUMNID = c.Int(nullable: false, identity: true), MYCOLUMNNAME = c.String(), }) .PrimaryKey(t => t.MYCOLUMNID); Then I try to insert data with : using (var context = new MyContext()) { context.MyNewTableDbSet.AddOrUpdate(new[] { new MyNewTable { MYCOLUMNNAME = "Test"

Creating a Symmetric AES128 Key in SQL Server based on Key and Initial Vector

两盒软妹~` 提交于 2020-03-18 16:40:28
问题 I have some Key and Initial Vector, which I'm using for encryption purposes in my .NET app. Let's say they are: Key = 0x0102030405060708090A0B0C0D0E IV = 0xA1A2A3A4A5A6A7A8A9AAABACADAE In some cases I would like to perform encryption on the SQL Server (not in the app), but decrypt the data in the app. I thought that I'll might be able to create a temporary symmetric key in the DB and perform encryption: CREATE SYMMETRIC KEY #TempKey WITH ALGORITHM = AES_128 , IDENTITY_VALUE = ??? , KEY_SOURCE