Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

entity-framework-core

Entity Framework Core – How to check if database exists?

September 5, 2023 by Tarik

I have found the solution on my own: (context.GetService<IDatabaseCreator>() as RelationalDatabaseCreator).Exists() It works for EF 7.0.0-rc1-final version for SqlServer UPDATE: Entity Framework Core 2.0: (context.Database.GetService<IDatabaseCreator>() as RelationalDatabaseCreator).Exists()

Categories entity-framework-core Tags entity-framework-core Leave a comment

What happened to AddOrUpdate in EF 7 / Core?

June 14, 2023 by Tarik

It’s waiting to be implemented. See issues #629 & #4526. Update: according to comments below (unverified) – this feature is finally slated for release in .NET Core 2.1!

Categories entity-framework-core Tags entity-framework-core Leave a comment

Select multiple nested levels of child tables in Entity Framework Core

March 23, 2023 by Tarik

You can use the keyword ThenInclude instead e.g. var company = context.Companies .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Car) .Include(co => co.Employees).ThenInclude(emp => emp.Employee_Country) .FirstOrDefault(co => co.companyID == companyID);

Categories entity-framework-core Tags entity-framework-core Leave a comment

Need to Update EF Core Tools

October 8, 2022 by Tarik

Use command line, Cmd or PowerShell for specific version: dotnet tool update –global dotnet-ef –version 3.1.0 or for latest version use (works also for reinstallation): dotnet tool update –global dotnet-ef

Categories entity-framework-core Tags entity-framework-core Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa