Questions tagged as 'entity-framework'

3
answers

How to mount a lambda expression and pass it by parameter to a generic function?

I need to pass two parameters to a generic function that returns data from the database and select only a few specific columns to display in a DataGridView . public List<TEntity> GetAll(Expression<Func<TEntity, bool>> P...
asked by 07.11.2016 / 09:27
1
answer

When changing a Model, how to redo Scaffolding?

I have a model, called CombustivelModels , where I made a Scaffolding generating Controller and Views , my doubt is, when doing a revision in this Model , you can update via Scaffolding o Controller...
asked by 30.11.2016 / 14:39
1
answer

Development without EF ORM

It is worth developing without ORM, because today I want to develop an ERP, but I have no knowledge in any framework , is it worth doing everything at hand? Will I have the same result? Well, I realize that I'm wasting a lot of development t...
asked by 08.04.2017 / 00:57
1
answer

How to do a SELECT with Entity Framework?

I'm developing a kind of a QUIZ in C #, and I've already been able to do the INSERT questions and the answers in the database, but I'm having a hard time bringing the question and the bank's response to the quiz. Type a select, because I just...
asked by 08.08.2016 / 22:26
2
answers

Connecting to the database in ASP.NET with EntityFramework

I need to migrate a system from one server to another. The system is in ASP.NET and the connection to the database is a bit strange. I need to know how to connect to the database. The only thing I found about connection in Web.Config...
asked by 11.07.2016 / 21:49
1
answer

Many relationship to many ASP.NET Entity Framework

I'm having trouble making the relationship between my tables using EF. At the time of creating a Maintenance Order, I need to list the data registered in other tables, such as Equipment, Tasks and Person, as I try to represent in the class be...
asked by 29.10.2016 / 03:15
1
answer

Entity Framework - Problem in relationship association 1 to 0..1

I'm having an association problem between two tables. Student and Student tables_Course_Unit. Public class Aluno { [Key] public int cod_aluno { get; set; } ........ public virtual Aluno_Unidade_Curso Aluno_Unidade_Curso { ge...
asked by 20.04.2016 / 22:41
1
answer

Where should I put ConnectionString in Windows Forms with EF?

I'm having the following error using Entity Framework:    Additional information: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFram...
asked by 26.08.2016 / 23:23
1
answer

Update multiple records with EntityFramework

Assuming I have the following query: UPDATE tb_foo SET idoso = 1 WHERE idade > 65 To perform this same process in linq, I have IEnumerable<Foo> foos = contexto.Foos.Where(e => e.Idade > 65); foreach(var item in foos) {...
asked by 05.01.2016 / 20:33
1
answer

How to insert entity with ID in the Entity Framework

How to insert an entity with ID in Entity Framework 6.0? That is, insert with ID because the table does not generate it. For example: var last = _contexto.Area.AsEnumerable().LastOrDefault(); area.Id = last !=null ? last.Id + 1 : 1; _contexto...
asked by 05.01.2016 / 20:34