Category "entity-framework"

.Error CS1061 'Task<IEnumerable>' does not contain a definition for 'Where' and no accessible extension method 'Where'

My generic repository is as follows ( I have similar in synchronious and it works) public virtual async Task<IEnumerable<TEntity>> GetAsyn( Expr

Entity Framework Core multiple connection strings on same DBContext?

I have an Asp.Net Core app with Entity Framework Core that I initialize as follows: services.AddDbContext<ApplicationDbContext>(options => o

Table 'tblCustomer' does not have the identity property. Cannot perform SET operation

Occurs when I try to set the identity_insert to ON in the SQL DATAMANAGEMENT STUDIO. The worst is I do not know why should I deal with this value, and I am not

Entity Framework : Value cannot be null. Parameter name: type

When I execute update-database command, it shows this error message System.ArgumentNullException: Value cannot be null. Parameter name: type at Sy

Oracle V$SESSION Machine is <ComputerName>\<ComputerName> instead of <Domain>/<ComputerName>

I've a strange behavior with oracle and it's seems it causes problem with Security Policies. When I look the V$Session table, some connection "MACHINE" are only

Get ID of item selected in ComboBox

I have a ComboBox that gets filled with items from my database. I'm trying to get the ID of the item that is selected in the ComboBox, but nothing I've tried se

Getting the result of a computed column from database into an entity

In a project using Entity Framework, say I have an entity such as [Table("MyTable")] public partial class MyTable { public string FirstName { get; set; }

Entity Framework rollback and remove bad migration

I'm using EF 6.0 for my project in C# with manual migrations and updates. I have about 5 migrations on the database, but I realised that the last migration was

Unable to update database to match the current model because there are pending changes

I have a project built in visual studio 2013 environment with the Db built using EF 5 code first. I have had my APIs working fine for a long time but all of a

Code first migration error "Implicit conversion from data type nvarchar(max) to varbinary(max) is not allowed"

I changed the data type of a field in my model from string to byte array and I got this error when I run Update-Database code first migration method. Implic

Entity Framework Core error "Column names in each table must be unique"

I have manually added the column IdCategory to my table Books, and now each time I try to run Update-Database, I get this error: fail: Microsoft.EntityFramewor

Enable-Migrations Exception calling "SetData" with "2" argument(s)

I created a library based on .NET 4.6.2 version. To the library, I've added the EntityFramework version 6.1.3 package. I created a model as follow using Syst

Select multiple columns using Entity Framework

Maybe an easy question, but can't find it easily so forgive me =) I try to select multiple columns. The statement I use is: var dataset2 = from recordset in en

Sorting a 1-to-many relationship for a log table for the most recent item

So I have a table, Equipments, that contains assets. There is a table connected to this one in a 1-many relationship that logs each time it is inventoried, by w

How can I use a built Expression in an Include .Where() to apply an Include Filter when it expects Expression but only allows Func?

I'm getting some errors trying to build expression trees on nested collections. I have classes: // not DB entity public FilterTerm { public string Compariso

Unable to create a controller when using asp.net MVC 4/Entity Framework.

I am new to asp.net, and I am now facing a problem. I have created a project using asp.net mvc4, and I have added an entity data model and successfully connect

Displaying an iframe with @Html.Raw is not working like when displaying Script with @Html.Raw

Note: This is written in asp.net mvc 5. That is the tech I am using for this. I am used to displaying certain data when I use @Html.Raw to show data from a Mode

Identity UserManager CreateAsync does not write to database

It doesn't give any errors or warnings but it doesn't insert in the database. Seems like it's only in memory. Also UserManager's FindByNameAsync can't check use

Why is not working EF Core retry on failure

I've configured my db context to retry on failure this way: optionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction: sqlOptions => {

EntityFramework in test initialization error: CREATE DATABASE statement not allowed within multi-statement transaction

I'm trying to build a quick test that deletes and recreates a database every time it runs. I have the following: [TestClass] public class PocoTest { priva