Questions tagged as 'entity-framework'

1
answer

Problem returning Entity models: "The entity or complex type ... can not be constructed in a LINQ to Entities query"

I'm trying to return a list of objects generated by the DataBase First of the Entity Framework but I get this error:   The entity or complex type 'leaosites04Model.TB_LEMBRETES' can not be constructed in a LINQ to Entities query. I'm tryi...
asked by 03.07.2014 / 10:49
1
answer

Linq - Search for objects that have a pre-determined list

I have a many-to-many entity, many students for many subjects. And I need to get all the students who have all the materials I want. For example, subjects: Mathematics, Portuguese and Physics. I need to get only the students who have these th...
asked by 20.01.2016 / 17:36
1
answer

How to return dynamic list?

How to return a List<dynamic> in ASP.NET MVC 5 and EntityFramework 6 For example I have an Object named User and mapped in my EDMX, when I do to bring the data dynamically type make an advanced query without returning an object o...
asked by 24.12.2014 / 18:16
1
answer

How to force an Exception when trying to delete a Master record that already contains relationship in a Child Registry?

I have created the following structure in SQL Server: UsingEntityFrameworkwithCode-First,theclasseslooklikethis:[Table("Master")] public class Master { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; s...
asked by 18.03.2015 / 16:58
1
answer

Query in several fields of the record in a single query

I'm developing an item list filter, and would like to filter by any term in the item record. I've seen this working on Angular, but I'm developing for ASP.NET MVC 5 and using the Entity Framework + Linq for queries. Has anyone ever been throu...
asked by 11.09.2015 / 15:34
1
answer

Issues with accent and Entity Framework

This is an excerpt from my search method at the bank: public dynamic GetAll(Func<TEntity, bool> predicate, int limit, ClassContexto contexto, int idEmpresa) { dynamic data = null; try { data = li...
asked by 11.09.2015 / 03:07
1
answer

How to return search regardless of accent on Asp.Net MVC systems [closed]

I have a problem with a system in relation to the search that does not return a result for reasons of emphasis. I would like to know how to make the accent be ignored in the system? Note The system is already hosted and running with SQL Se...
asked by 29.10.2017 / 22:09
1
answer

Converts a SQL query to Query in Entity

I asked this question in another forum, but the content of the discussion followed another way so I decided to open this topic. Without skipping the subject, how do I perform this SQL query: select p.RA, p.Nome, p.Modulo, a.Descricao from insc...
asked by 15.09.2017 / 14:43
1
answer

Entity Framework: Data Model with column with the largest possible number of characters

I'm creating tables with Entity Framework , and I'm using Data Annotation to determine the amount of characters, I wanted to know what the largest size supported for typing text and if the correct type would be string same?...
asked by 18.01.2017 / 22:48
1
answer

The method or operation is not implemented error

When I add a record to my Include screen, this error appears to me. What can it be? Service public void AddItem(Test item) { var codigos = this.context.Tests.SingleOrDefault(x => x.Codigo == item.Codigo);...
asked by 21.08.2015 / 15:19