entity-framework-core

Error 50 during the initial DATABASE creation

I am writing an application for core 3.0, EF 6. Connection string: "DefaultConnection": "Server=(localdb)\\usersdb;Database=l ... r: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.

The "TestDB" database requested by the login cannot be opened. Failed to log in

The "TestDB" database requested by the login cannot be opened. Failed to log in. An error occurred when logging in to the use ... ver=\SQLEXPRESS; Database=TestDB; Trusted_Connection=true; User Id = ; Password = ;" Microsoft.EntityFrameworkCore.SqlServer

Please explain how Update works in the Entity Framework

I don't understand how to work with Entity Framework. After Laravel and its ORM, it seems to me a completely unfriendly techn ... ticize my code and I will be grateful for useful comments that could simplify the life of readers. Thanks for your attention!

MS SQL Rounding to the nearest even number

I have logic in a c# application that I was forced to start duplicating on the slq server in views and stores, and faced with ... How do I make the ROUND behavior in MS SQL the same as in c#? PS Server version: MSSQL2016 (13.0.1601.5), .net core 2.1

Counting the total time the user spent in the discord voice channel

I think the code will not be clear what I wrote because the function itself is large, I will try to briefly tell you. In gene ... | {total.Minutes} min | {total.Seconds} sec."); await ReplyAsync(embed: eb.Build()); } }

Migration error: column already exists

Trying to add a migration: dotnet ef migrations add add_ProductGroup --context migrationsdbcontext dotnet ef database updat ... TeamExplorer. Maybe the column ProductGroupId wasn't deleted from the table Products. It is not clear how to delete it now

How to select a string in Linq to entity where there is a null object

var delete = db.Users.Where(t => t.Name == null); db.Users.RemoveRange(delete); db.SaveChanges(); I use linq to select th ... l object in the table in the request, and are there any other such oddities in linq to entity?(I Use Entity Framework core 5)

Issues updating related objects using Entity Framework and ASP net core 3

Hello friends, I hope everyone is OK! I am trying to update two entities using Entity Framework core 3.0. The parent entit ... al e executar seus devidos *inserts* e *updates*. Gostaria de saber uma forma mais elegante e mais simples de se fazer isso.

Add-Migration does not work in EF Core 3

Good afternoon. When trying to generate an initial migration to create the database structure, I get the following error: " ... ction": "Server=(localdb)\\mssqllocaldb;Database=MinhaApiCore;Trusted_Connection=true;MultipleActiveResultSets=true" }

Check if any user has logged in, and get the logged in user-core 2.1

Hello I need to check if you hear any user authentication, and after checking if any user has authenticated take the ID of th ... ute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }

IDENTITY INSERT is set to OFF-Entity Framework Core

I am working on an application with ASP. net-core + entity-framework-core and with mapping and configuration via fluent-api ... > m.Registros) .WithOne(m => m.Material) .OnDelete(DeleteBehavior.Restrict); } What am I doing wrong?