Entity framework core migrations

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 168

  • @naodagere8210
    @naodagere8210 4 роки тому +29

    I am always amazed by the amount of time and energy you invest while preparing these materials.Still for free.Thank you so much.

  • @ПавелБываев
    @ПавелБываев 5 років тому +108

    I cant use Add-Migration before installed "Microsoft.EntityFrameworkCore.Tools"
    in PM console: Install-Package Microsoft.EntityFrameworkCore.Tools

    • @amey203
      @amey203 5 років тому

      thank u so much bro .it helped me

    • @erkangorgulu6013
      @erkangorgulu6013 5 років тому

      I knew i was missing a package but thinking what it could be. Much appreciated.

    • @amermagdy5440
      @amermagdy5440 4 роки тому +2

      if there is any rollback try to specify the version by this command line
      Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.1.14
      also for guarantee your needed version look in the warning

    • @jainamshah5681
      @jainamshah5681 4 роки тому +1

      Helped me too. Thanks a lot.

    • @hexlatino3421
      @hexlatino3421 4 роки тому

      Thank u. you saved me at least 1 hour of my time :)

  • @stephenriding6460
    @stephenriding6460 5 років тому +1

    Couldn't figure out for the life of me how to actually create the database. Didn't know about update-database. Thank you so much for this video!

  • @yasirirfan5262
    @yasirirfan5262 8 місяців тому

    You are making great .NET Engineers.
    Be blessed.

  • @hzubaca
    @hzubaca 4 роки тому +1

    simple, and straight to the point! Kudos!

  • @mohdsyazwiabhalim8122
    @mohdsyazwiabhalim8122 Місяць тому

    Best tutorial ever. Thanks!!

  • @talkathiriify
    @talkathiriify 5 років тому +3

    Thank you again
    for the excellent video
    Best regards

  • @vaibhavtrikolikar4902
    @vaibhavtrikolikar4902 4 місяці тому

    Thank you Sir for another great video As usual:)

  • @hamedbakhtiari7540
    @hamedbakhtiari7540 4 роки тому +7

    Thank you, so much , but in .net core 3 and newer version we should install EntityFrameworkCore.Tools and then use Add-Migration

  • @mprto68
    @mprto68 Рік тому +1

    I keep getting an error when migrating "unable to create an object of type 'dbcontext'."

  • @neilsumanda1538
    @neilsumanda1538 4 роки тому +4

    i always wonder how much effort the developers into this migration.. in practice, u dnt create a database from the ground-up, u work with an existing database with actual records.. or did i missed something here...?

  • @honeesh1
    @honeesh1 5 років тому

    My teacher thank you very much
    Very useful lectures too
    Thank you from the depths

  • @00kiss00L
    @00kiss00L 4 роки тому +1

    If you are using MacOS version of Visual Studio, you might stuck at this episode. You won't find SS Object Explorer nor Package Manager Console because none of those are supported. Here is what I did:
    1. Install NuGet PowerShell Core Console:
    lastexitcode.com/blog/2019/05/05/NuGetPowerShellCoreConsoleVisualStudioForMac8-0/
    2. Install Entity Framework Core tools:
    docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell
    3. Install SQL Server on Mac (Docker + Azure Data Studio):
    database.guide/how-to-install-sql-server-on-a-mac/
    4. Change the connection string to something like this:
    "Server=localhost;Database=sql_server_demo;User Id=sa;Password=ReallyStrongPwd123"

  • @zn6151
    @zn6151 3 роки тому

    The explanation is amazing 👏

  • @lin4469
    @lin4469 3 роки тому +1

    I have an error...
    The specified deps.json [D:\GitFirstCode\OnlineShop\Shop.UI\Shop.UI.deps.json] does not exist

  • @xinjinli6442
    @xinjinli6442 2 роки тому +1

    Really good material.
    But I have a question.
    When I have only schema updates, everything works okay.
    Now I have seed methods to add some records to the database.(For example menu items, rights, roles)
    And I tried to run add-migration whenever I have updates in schemas.
    It worked yet.
    But I wanted to add some more records. I mean I updated the seed methods.
    And then run
    add-migration update_seed.
    After that, update-database failed.
    Would you help me with how to handle the cases?

  • @lifetraveler8008
    @lifetraveler8008 4 роки тому +1

    I am getting the following error
    System.ArgumentNullException: 'Value cannot be null. (Parameter 'connectionString')'
    help please!!
    I found the problem
    The ConnectionStrings inthe appsetting.json had space in between the word Connection and string . It should be "ConnectionStrings" and not "Connection Strings"

    • @rashedalqadi3695
      @rashedalqadi3695 4 роки тому

      stackoverflow.com/questions/40874640/value-cannot-be-null-parameter-name-connectionstring-appsettings-json-in-start
      there is some solution

  • @TheHPure
    @TheHPure 3 роки тому +1

    What about database first approach? I'm having really hard time figuring this out..

  • @sathyavenkatesh5047
    @sathyavenkatesh5047 5 років тому +1

    I think this Migration is only for Code First approach right and not for Database First approach ?

  • @ljupconewman9357
    @ljupconewman9357 5 років тому +1

    Eloquent and excellent.
    One thing though, after i added a migration and updated the database I can't see it in sql server. I tried by changing the connection string in several ways, but it didn't change anything. Maybe show this in your next video?

    • @saivaibhavmedavarapu7383
      @saivaibhavmedavarapu7383 5 років тому

      Can you send me the code of this project on vaibhav.medavarapu@gmail.com. It really helps me in catching up. Thanks

    • @menaf77
      @menaf77 5 років тому

      the same here too i can't see the database created in the sqlserver. pls share how you get it work

    • @bulldog2024
      @bulldog2024 5 років тому

      You might have to refresh the database and it should be there.

  • @prithupaul5177
    @prithupaul5177 4 роки тому +1

    Getting this exception while using "Add-Migration" command Method 'Create' in type 'Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitorFactory' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation. anyone can help?

  • @arpitmahyavanshi9282
    @arpitmahyavanshi9282 Рік тому

    i dont have any data in the db so i have to put some data in it or it will be done automatically accordin to this video

  • @bulldog2024
    @bulldog2024 5 років тому +1

    Thanks again for the great content.

  • @fermidu8811
    @fermidu8811 4 роки тому

    How can I update a dbcontext if I´m using database first? I hava my database ready, just need to update de context on EFCore 3.1, any help please?

  • @1eagleusa
    @1eagleusa 5 років тому

    Question about field creation, the filed for department is enum and is nullable, in the video it creates the filed in the table as integer and nullable if false. I think I understand the integer part but should it be nullable because the field is nullable? What if it was desired to have the field nullable how would it be accomplished to signify nullable field during migration? Thank you for all your hard work.

  • @sinanukuslu5420
    @sinanukuslu5420 5 років тому

    Çok teşekkür ediyorum. Çok iyi anlatıyorsunuz.

  • @arpansarkar7924
    @arpansarkar7924 4 роки тому +1

    If you are getting error during add-migration Install Entity framework core package.

  • @jaikialves3186
    @jaikialves3186 3 роки тому

    Thank you, your video save me

  • @halivudestevez2
    @halivudestevez2 3 роки тому

    thank you, Sir, it's clear now! :)

  • @AllanMadsenDK
    @AllanMadsenDK 5 років тому

    Is it possible to use the PM to create and manage stored procedures? I have been told, that using stored procedures, is the safest way, to interact with the SQL database.
    Thank you for some very great toturials!!

  • @MmMm-tg5mq
    @MmMm-tg5mq 5 років тому

    very informative nice video thanks a lot

  • @HarshRaj-pu4gi
    @HarshRaj-pu4gi 4 роки тому +1

    I am getting error while trying to insert data saying "Cannot insert explicit value for identity column in table ' ' when IDENTITY_INSERT is set to OFF. Do anyone knows solution to this?

    • @gealglover2479
      @gealglover2479 4 роки тому

      First thing I noticed is the table "Employees" will be built with field "Id" being an identity column. The migration shows .Annotation("SqlServer:Identity", "1, 1") while his tutorial shows .Annotation("SQLserver:ValueGenerationStrategy"). You should therefore not supply a value for the Id when inserting data.

  • @eugene-white-shark
    @eugene-white-shark 3 роки тому

    Thank you very much!

  • @leoniduvarov6565
    @leoniduvarov6565 4 роки тому

    Very clear, thank you!

  • @alwaseem5309
    @alwaseem5309 5 років тому

    Awesome !

  • @Viktor_fff
    @Viktor_fff Рік тому

    Thanks for help)

  • @areensahu5299
    @areensahu5299 3 роки тому

    I dont why I cant use Commands like Add-migration and Update Database. I have also tried installing Microsoft.Entityframeworkcore.tools NuGet package but it wont install. Please help.

  • @khoinguyen4400
    @khoinguyen4400 5 років тому

    How can I create a table within an existing schema when I run update-Database. Please help

  • @InamiLanzhu
    @InamiLanzhu Місяць тому

    Another wonderful lecture, thanks! 50/124

  • @mohammadhilal8508
    @mohammadhilal8508 4 роки тому

    While doing migration it gives an error deps. Json(path) does not exist.

  • @kokaneehooman
    @kokaneehooman 5 років тому

    package manager console does not recognize the add-migration command. how do fix this?

    • @krishnakishore2889
      @krishnakishore2889 5 років тому

      in the package manager console run this command Install-Package Microsoft.EntityFrameworkCore.Tools

  • @jihedjaoidi4313
    @jihedjaoidi4313 5 років тому +4

    Plz I want buy à tutorial for unit test how I do that plz thank you

    • @VinuP2023
      @VinuP2023 5 років тому +2

      Venkat has a tutorial on Unit Testing in Udemy. Please find it

    • @ljupconewman9357
      @ljupconewman9357 5 років тому

      @@VinuP2023 does he have about other topics?

  • @lennonfernandes1696
    @lennonfernandes1696 2 роки тому

    I am getting "build failed" error while running the command "add-migration migrationName"
    Earlier I had accidentally typed "update-database migratonName" instead of "add-migration migrationName" and then got an error. From then on I am getting "build failed" error..

  • @jrh383
    @jrh383 3 роки тому

    Hola prof. este método de migraciones da terror, ya que si cuento con bases de datos de cientos de gb, no me convence que el programador tenga acceso a esto, ya que por una mala programación pueden borrar los datos, además existen especialistas en BD, por favor podrías indicar si tienes un enfoque base de datos primero. Y de veras muchas pero muchas gracias por dedicar tanto de tu tiempo y explicas perfectamente. nuevamente gracias.

  • @coolwaterdvr
    @coolwaterdvr 5 років тому +1

    Thank you Venkat.

  • @ypwygk652
    @ypwygk652 4 роки тому

    i have this error, Method 'Create' in type 'Microsoft.EntityFrameworkCore.SqlServer.Query.Internal.SqlServerSqlTranslatingExpressionVisitorFactory' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.

  • @henimex
    @henimex 3 роки тому

    Thank you. Again

  • @TheSivac
    @TheSivac 4 роки тому

    Any help for this error I get: "The entity type 'Pile' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()". I already tried putting the [Key] attribute above my PileId property... Didnt help

  • @amermagdy5440
    @amermagdy5440 4 роки тому

    if there is any rollback try to specify the version by this command line
    Install-Package Microsoft.EntityFrameworkCore.Tools -Version 2.1.14
    also for guarantee your needed version look in the warning

  • @mdsaddamkhan8400
    @mdsaddamkhan8400 4 роки тому

    I am getting this error in Package Manager console
    invalid value for key ' integrated security'
    Please someone help

  • @amreenmujahed76
    @amreenmujahed76 5 років тому

    hello venkat sir please help me ,i m unable to update-database cammand in console package manager

    • @lukedodson3441
      @lukedodson3441 5 років тому

      Same

    • @Rakesh_Bandaru
      @Rakesh_Bandaru 4 роки тому

      MOdify connection string as "EmployeeDBConnection": "Server=.;Database=EmployeeDB;Trusted_Connection=true"

  • @التاريخ-ح4ظ
    @التاريخ-ح4ظ 4 роки тому

    PlatformNotSupportedException: LocalDB is not supported on this platform. ??ubuntu

  • @AndrewBarzyk
    @AndrewBarzyk 5 років тому

    I cannot get the migration to work. I ran it -v to get the error:
    Microsoft.EntityFrameworkCore.Design.OperationException: Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time, see go.microsoft.com/fwlink/?linkid=851728 ---> System.MissingMethodException: No parameterless constructor defined for type 'ConciergeApp.Models.AppDbContext'.
    at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
    at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
    much Internet ink was spilled on removing the dbContext from Startup.cs and moving it to Program.cs...
    I know my connection string is ok (MYSQL) because when I create the database and tables columns manually my application runs. I am using the latest version of Visual Studio Community 2019. Has MS changed something again???

    • @AndrewBarzyk
      @AndrewBarzyk 5 років тому

      I got it working. I was using Visual Studio 2019. Apparently in true MS style, they released it without full support for a bunch of features.

  • @MuhammedAli-nu4tb
    @MuhammedAli-nu4tb 5 років тому

    "Format of the initialization string does not conform to specification starting at index 0." I get an error

  • @coderggk6819
    @coderggk6819 4 роки тому

    But 99% of projects does have existing Database. does it means this code first wont work?

  • @AhmedGamalGIS
    @AhmedGamalGIS 5 років тому

    thanks alot My teacher need tutorial for unit test in asp.net core

  • @DecklonNyarko
    @DecklonNyarko 5 років тому +1

    Hiya, thanks for your hard-work very much appreciated. my project given me the error "There is already an object named 'AspNetRoles' in the database." when i tried to update database

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  5 років тому +1

      Hello Decklon - That's a bit strange. These kind of errors usually happen if we manually create or change Identity tables without going through migrations.

  • @ymn76ymn
    @ymn76ymn 3 роки тому

    thanks for you

  • @КсенияЮдина-ж6о
    @КсенияЮдина-ж6о 5 років тому

    I can't find the mdf file..

  • @sebastianph4378
    @sebastianph4378 5 років тому +1

    how can I resolve this error in the package manager console, "Unable to create an object of type 'appDbContext'. For the different patterns suppported at design time, see go.microsoft.com/fwlink/?linkid=851728"

    • @marwan_sa5905
      @marwan_sa5905 4 роки тому

      I'm facing the same issue, have you resolve it ?

    • @marwan_sa5905
      @marwan_sa5905 4 роки тому +1

      o solve it the issue was i was missing ( , ) in appsetting.json after MyKey there was , missing
      {
      "Logging": {
      "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
      }
      },
      "AllowedHosts": "*",
      "MyKey": "Value of MyKey from appsettings.json",
      "ConnectionStrings": {
      "EmployeeDBConnection": "Server=(localdb)\\MSSQLLocalDB;database=EmployeeDB;Trusted_Connection=true"
      }
      }

  • @darkogele
    @darkogele 5 років тому +4

    Great job as always keep it up ill build you a Monument if i become rich :D

    • @MmMm-tg5mq
      @MmMm-tg5mq 5 років тому

      I think he didn't need your Monument , if you can help just donate at his blog

    • @argeltal9090
      @argeltal9090 4 роки тому +1

      И јас го делам истото мислење за чоеков !

  • @mdsaddamkhan8400
    @mdsaddamkhan8400 4 роки тому

    i am getting this exception please help me
    ArgumentException: Invalid value for key 'integrated security'.

    • @PriyankaSoni2014
      @PriyankaSoni2014 4 роки тому

      try Trusted_Connection=True instead of integrated security at EmployeeDBConnection in Appsetting.json file

    • @mdsaddamkhan8400
      @mdsaddamkhan8400 4 роки тому

      @@PriyankaSoni2014 yup... I used the same I am getting different level of error right now

    • @Abhimanyukumar-vb8bz
      @Abhimanyukumar-vb8bz 4 роки тому

      @@mdsaddamkhan8400 use -> integrated security= SSPI

  • @rayt6867
    @rayt6867 5 років тому

    So far so good, Excellent tutorial, Is the source code in Github or any other place to download it, so that I can compare with mine to keep the videos in sink? Thank you very much.

    • @hooiyan6040
      @hooiyan6040 5 років тому

      Hi! The souce code can be found on the blogspot. You can check them out at the description section under every videos. :)

  • @RachitJain4U
    @RachitJain4U 3 роки тому

    Thanks sir :)

  • @SPRajOfficial
    @SPRajOfficial 4 роки тому

    I want to create mysql db migrations code first? Can u guide?

    • @goldencourses645
      @goldencourses645 3 роки тому

      Just Install this package mysql.entityframeworkcore5.0.0 instead of SQL.EntityFramework and do the same (connection string to your mysql db)

    • @meeramaahidoshi1207
      @meeramaahidoshi1207 3 роки тому

      @@goldencourses645 can u suggest me the connection string to sql server connection as i am getting error in it
      what would be the connection string if we want to connect to sqlserver with sql server authentication
      "EmployeeDBConnection" : "server=(192.168.1.97,9905
      )\\sa;database=EmployeeDB;Trusted_Connection=True"
      got confused. where the pwd and authentication to be entered

  • @ypwygk652
    @ypwygk652 4 роки тому

    i have error
    Exception has been thrown by the target of an invocation.

  • @muhammetsamkara1074
    @muhammetsamkara1074 5 років тому

    when program trying to read EmployeeDBConnection in start up I get an error of "System.ArgumentNullException: 'Value cannot be null.
    Parameter name: connectionString'
    " anybody who can help?

    • @renanrosa5527
      @renanrosa5527 5 років тому

      You are missing the letter 's' after the ConnectionString property name in the appsettings.json when using Configuration.GetConnectionString("name")
      Here is mine:
      "ConnectionStrings": {
      "EmployeeDBConnection": "server=(localdb)\\MSSQLLocalDB;database=EmployeeDB;Trusted_Connection=true"
      }

  • @sanaafzal5316
    @sanaafzal5316 5 років тому

    thankyou sooooo much sir for these course......actually i have some problem in package manager console.......when i write Update_Database there is error occour. version problem how i solve this problem
    (The EF Core tools version '2.1.1-rtm-30846' is older than that of the runtime '2.1.11-servicing-32099'. Update the tools for the latest features and bug fixes.)

    • @tarn4t1on79
      @tarn4t1on79 5 років тому +1

      That's not an error, that's a warning. It'll still work just fine.

  • @lejinad5
    @lejinad5 5 років тому

    Hello!
    I am getting error when try to Add-Migration in PM:
    PM> add-migration
    cmdlet Add-Migration at command pipeline position 1
    Supply values for the following parameters:
    Name: InitialMigration
    No migrations configuration type was found in the assembly 'WebApplication5'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).
    When I type Enable-Migrations it said "No migrations configuration type was found in the assembly WebApplication5"
    But I do have AppDbContext.cs in dir. Models, and I have public class AppDbContext : DbContext (using Microsoft.EntityFrameworkCore)
    Can you please help me why I got this error?
    Thanks for great content!

  • @avitwito1734
    @avitwito1734 5 років тому +1

    How did it knew that the primary key should be ID? (table.PrimaryKey("PK_Employees", x => x.Id);)

    • @bulldog2024
      @bulldog2024 5 років тому +1

      I believe, by convention, Entityframework will automatically look for a field that contains the term 'Id' and make that the primary key unless you use the [Key] attribute.

  • @arunnayak3342
    @arunnayak3342 3 роки тому

    Please make a video on Response caching in .net core if possible

  • @SrikanthPuli4
    @SrikanthPuli4 4 роки тому

    Could you make payment gateway in c# .net please.

  • @OutNumbered41
    @OutNumbered41 2 роки тому

    Every time I attempt to do this I get an error saying Could not load assembly ''. Ensure it is referenced by the startup project 'Entity'

  • @rimplechristian361
    @rimplechristian361 2 роки тому

    how to add with DB first approch

  • @BalooCSGO69
    @BalooCSGO69 4 роки тому +1

    You fucking king, You helped me so much, thank your my good friend.

  • @balkishan2k11
    @balkishan2k11 4 роки тому

    How to implement automatic migrations without any dataloss

  • @MmMm-tg5mq
    @MmMm-tg5mq 5 років тому

    perfect

  • @kassandrasandoval8195
    @kassandrasandoval8195 4 роки тому

    How does it know to name the database EmployeeDB?

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  4 роки тому +1

      Hello Kassandra - The database name is specified in the conncection string in appSettings.json file. Hope this answers your question.

    • @kassandrasandoval8195
      @kassandrasandoval8195 4 роки тому

      @@Csharp-video-tutorialsBlogspot I see! I was confused because I would think the connection String value would come from the database name, not the other way around. Thank you for replying!

  • @prakashbuchade7642
    @prakashbuchade7642 5 років тому

    How can I use CosmosDb in back end with er core and migration?

  • @deepwoodsengineering3763
    @deepwoodsengineering3763 5 років тому

    Thank You

  • @salmanchowdarym1110
    @salmanchowdarym1110 5 років тому

    Thanks

  • @nolimitsREAL
    @nolimitsREAL 5 років тому

    Seems a little bit complicated, just to create a database from the class that you created it.

  • @iamanalyst4u
    @iamanalyst4u 5 років тому

    Package manager consol not available on linux

    • @bulldog2024
      @bulldog2024 5 років тому +1

      You should be able to use the .net cli in the terminal to accomplish the same thing.

    • @sarozpradhan64
      @sarozpradhan64 4 роки тому

      @@bulldog2024 how?? explain

  • @karimkazia
    @karimkazia 5 років тому +1

    Excellent Video. though I came across an issue during the first process of migrations. i had to replace _config with configuration.UseSqlServer(XXXXXXX). otherwise it was not able to resolve the connection string name

  • @onurfurkan6757
    @onurfurkan6757 5 років тому

    ScriptHalted ?

  • @lukedodson3441
    @lukedodson3441 5 років тому

    Can't run a server on a 32bit machine :(

  • @opraju
    @opraju 5 років тому +1

    I am unable to run InitialMigration - I am getting error
    InitialMigration : The term 'InitialMigration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
    was included, verify that the path is correct and try again.
    At line:1 char:1
    + InitialMigration
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (InitialMigration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    • @whopawan8384
      @whopawan8384 5 років тому

      IF PACKAGE MANAGER CONSOLE DID NOT FIND SESSION RUN THIS COMMAND ON PM.
      PM> Install-Package Microsoft.EntityFrameworkCore.Tools

    • @anvineet
      @anvineet 4 роки тому

      I also get error after update name:
      PM> Add-Migration
      cmdlet Add-Migration at command pipeline position 1
      Supply values for the following parameters:
      Name: InitialMigrainV
      An error occurred while accessing the IWebHost on class 'Program'. Continuing without the application service provider. Error: Could not parse the JSON file. Error on line number '7': '},
      "AllowedHosts": "*",,'.
      Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time, see go.microsoft.com/fwlink/?linkid=851728

    • @anvineet
      @anvineet 4 роки тому

      Name: InitialMigration
      An error occurred while accessing the IWebHost on class 'Program'. Continuing without the application service provider. Error: Could not parse the JSON file. Error on line number '7': '},
      "AllowedHosts": "*",,'.
      Unable to create an object of type 'AppDbContext'. For the different patterns supported at design time, see go.microsoft.com/fwlink/?linkid=851728

    • @anvineet
      @anvineet 4 роки тому

      To avoid this situation, I create separate project and copy model/ startup project, then again try with "Add -Mirgration", We found this works.

  • @عمربنعبدالعزيزمحمدصالح-ر1ض

    I have Error:Value cannot be null.
    Parameter name: connectionString

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  5 років тому +1

      This could have been caused by connection string not being initialised. Can you check if that's not the case. Hope this helps.

    • @charkaouiomar1995
      @charkaouiomar1995 5 років тому

      stackoverflow.com/questions/40874640/value-cannot-be-null-parameter-name-connectionstring-appsettings-json-in-start

    • @mughalnouman2406
      @mughalnouman2406 4 роки тому

      @@Csharp-video-tutorialsBlogspot I have got the error the build failed

  • @sabeenanarayanan8695
    @sabeenanarayanan8695 5 років тому

    After Giving the name for the migration it is showing the following error
    (Your target project 'Food' doesn't reference EntityFramework. This package is required for the Entity Framework Core Tools to work. Ensure your target project is correct, install the package, and try again.)
    Can you please tell me how to correct them

    • @UsmanAli-uzi
      @UsmanAli-uzi 5 років тому

      There could be 2 reasons:
      1- You did not import the Entity framework core package. Refer to video#46 on how to install the package.
      2- Or if you have already installed the package make sure when you open the nuget package manager console window, the correct project is selected. For example if you have 2 or more projects in your solution, one for web, one for data access and you only added the EFcore package to the data access project than make sure data access project is selected in the package manager console window.
      Another option is to select the data access project from the solution explorer before you open the nuget package manager console. That way it will know which project you want to run the migrations on.

  • @ksmith7611
    @ksmith7611 3 роки тому

    Ha figured out why I couldn't use Add-Migration then I came here to tell everyone and found out that I should of looked here first ha ha (or well I am still a noob)

  • @danieltutundziev5894
    @danieltutundziev5894 3 роки тому

    XD

  • @Ty1er
    @Ty1er 3 роки тому

    So far so gud

  • @oilha2011
    @oilha2011 4 роки тому

    Perfect, many thanks!

  • @audiofrank6747
    @audiofrank6747 3 роки тому

    Thank you so much!

  • @usamabaloch6178
    @usamabaloch6178 4 роки тому

    I don't see any data in data base in sql server object explorer... where i am wrong can someone tells me?