-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment out FillinDatabase(); in program.cs before add-migration #49
Comments
Thank you for the feedback, I will have a look about it and make some quick changes, probably this week-end, Getting Started part should not be a problem. Unfortunately no there is currently no other example than the swagger interface. I'm thinking of doing a front in blazor or something like that one day but for the moment there's no integration. |
@ddepassUSOM
Why did you need to comment Could you give some more details so I can better understand the problem ? |
In my case await FillInDatabase(); kicked off a seeding of database process which caused an error for me.\
When I commented that section out in program.cs I was able to Add-Migration then before update-database I uncommented the said await FillDatabase(); to seed the database via DbInitializer
This was my situation if you are not experiencing these issues, then great.
Dwight
From: Vianney Doleans ***@***.***>
Sent: Sunday, July 21, 2024 6:56 AM
To: VianneyDoleans/BlogCore ***@***.***>
Cc: ddepassUSOM ***@***.***>; Mention ***@***.***>
Subject: Re: [VianneyDoleans/BlogCore] Comment out FillinDatabase(); in program.cs before add-migration (Issue #49)
@ddepassUSOM <https://github.com/ddepassUSOM>
I didn't encounter any problems when I followed these steps to try and reproduce the problem :
* Clone the repository
* Open project and edit appsettings.json to
* "DatabaseProvider": "MsSQL",
* "ConnectionStrings": {
* "Default": "Server=.;Database=AnyRandomName;Integrated Security=True;TrustServerCertificate=True"
* }
* Open Package Manager Console
* Select DBAccess as default project
* Execute Add-Migration CreateInitialDatabase -Context MsSqlDbContext
* Execute Update-Database -Context MsSqlDbContext
* Run the project
Why did you need to comment await FillInDatabase(); before executing the Entity framework migration commands ? this method normally has no influence on these commands.
Could you give some more details so I can better understand the problem ?
thank you in advance.
—
Reply to this email directly, view it on GitHub <#49 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/APKZESPBKFRG2Z2SBIYCPLTZNOHULAVCNFSM6AAAAABKAMP4N2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBRGU3DKNZVGY> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/APKZESPYLBHACFVZYQIRVDTZNOHULA5CNFSM6AAAAABKAMP4N2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUFTOKDY.gif> Message ID: ***@***.*** ***@***.***> >
|
To get the project to work I had to do the following:
BEFORE EXECUTING -->
One would need to got to program.cs and comment out await FillInDatabase(); Line 81
Then run in my case - >Add-Migration CreateInitialDatabase -Context MsSqlDbContext
Then run in my case -> Update-Database -Context MsSqlDbContext
After Database is created then go back to Program.cs uncomment await FillInDatabase(); Line 81
Then run the startup project BlogCoreAPI
This will now initiate DbInitializer to pre-populate the database. Swagger will work fine.
So, there is nothing wrong with the code it's, awesome. Just update the wiki.
Thank you for your effort with this.
Do you have an example web application using this API?
Please
Thank you
Dwight
The text was updated successfully, but these errors were encountered: