jonpsmith / efcoreinaction Goto Github PK
View Code? Open in Web Editor NEWSupporting code to go with the book "Entity Framework Core in Action"
License: MIT License
Supporting code to go with the book "Entity Framework Core in Action"
License: MIT License
I am reading the chapter one right now. I found the WipeCreateSeed
as follows:
db.Database.EnsureDeleted();
db.Database.EnsureCreated();
if (!db.Books.Any())
{
WriteTestData(db);
Console.WriteLine("Seeded database");
}
My question: Is if (!db.Books.Any())
necessary here? We already have a brand new database before if (!db.Books.Any())
so !db.Books.Any()
always return true, IMHO.
The connection string shown in page 14
private const string ConnectionString =
@” Server = (local db)\nssql local dv;
Database=MyFirstEfCoreDb;
Trusted_Connection=True”;
is inconsistent with the one used in the code hosted in the git.
private const string ConnectionString =
@"Server=(localdb)\mssqllocaldb;
Database=MyFirstEfCoreDb;
Trusted_Connection=True";
Trying to access http://efcoreinaction.com/ , it seems to be down.
Had to install it maually.
Hi Jon,
I love your book and the way that you explained is easy to me to understand. However, there is a concern I still need to confirm. In the page 84 of the book, there is a sentence :
Also, the Find method isn’t affected by a model-level filter.
So what you means is we can actually get the soft-deleted item by using Find method? Can you share any resource that mentioned about it?
Thank you very much.
Hi @JonPSmith , how are you?
Thank you for a wonderful book on the EF Core.
As EF Core 3.0 is GA now, will you be releasing -
Thank you.
Hi Jon,
I just started reading this book. Really appreciate the detailed explanations on EFCore. I've downloaded the entire source code for Chapter 2 but unable to compile in VS 2019, .NET Core 3.1. Do you have any guideline on how do we migrate the codes from VS 2017 to VS 2019? Thanks.
Regards,
Jordan Lim
Hey Jon
I am getting this Exception when I am trying to update ICollection<Reviews>
'Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded
I have tried many solutions . but not worked !!
could you please help me ?
Just a minor thing overall, but anyway:
The book icon is showing only a broken image on the confirmed order page after checkout. That's because OneOrderPartial.cshtml in line 15 is setting the source to "#" instead of "@lineItem.ImageUrl". In addition there are books without image URLs, so a check if it's not null is necessary I guess. The same problem in ListBasketPartial.cshtml where the image source is set to "#" when it's null.
The ImageUrl needs to be set in DisplayOrderService.cs in line 60 or so as well with "ImageUrl = lineItem.ChosenBook.ImageUrl," to be loaded in the OrderListDTO
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.