Questions tagged as 'entity-framework-6'

1
answer

Default value for column of type Datetime

I have a table that has the DataRegistro field of type Datetime . I am using EntityFramework to generate the database ( I am not using the code first ) and I am adding the Computed property so that the column is populated automati...
asked by 01.09.2015 / 03:52
1
answer

Querry Lazy Loading on EF Code First

Is it possible to create a querry lazy loading using a DbContext that is doing Eager Loading? Is there any way I can specify that Company company = db.Comanies.Find(id); Does not this command have to bring the entities related to it?...
asked by 11.06.2018 / 17:11
2
answers

View Mapping with Entity Framework

I'm wondering how to map a View created in Oracle Database 11G with Fluent-API. Here is an excerpt from the view with alias: tran.id_transporte AS "ID Navio", tran.ds_nome_transporte AS "Navio", pemb.id_porto AS "ID Porto Embarque", pemb.ds...
asked by 08.02.2018 / 17:29
1
answer

If it exists, update one table and insert another, if not, insert the two

How to make an expression using EF so that when a certain list of objects is sent and already exists in the database, it is updated and the change is inserted into another history entity, otherwise, it inserts both entities. Example publ...
asked by 23.10.2015 / 22:20
1
answer

Hide ActionLink parameter

For example: /admin/Edit/1006 Is there any way to hide this id? Well, any malicious user can change the value and end up finding a user. I know that you should check the controller to see if the user can edit, but only by using ActionLink...
asked by 04.01.2015 / 01:04
1
answer

Application Layer

Based on this question and this other question , in an environment that uses Entity Framework and Asp.net MVC . I see in many examples not using the application layer, a use of the data layer ( Entity Framework ) in Co...
asked by 05.09.2014 / 21:29
1
answer

Exchanging Entity Framework EDMX by Code First

I have an application with EF5 using EDMX modeling and I have much more experience and affinity with Code First. Does anyone have any idea / tutorial on how to migrate from EDMX to Code First without changing the database and entity classes?   ...
asked by 10.03.2015 / 13:42
1
answer

CKEditor with MVC5 and EF6

I put CKEditor in my project. It works fine, but when I click the Save button it returns this error:    A possibly dangerous value Request.Form was detected on the client (Content=" <p> <span style="f..."). ") PS: I alre...
asked by 17.05.2014 / 19:17
1
answer

How to declare single-key fields with EntityFramework?

One thing that many are looking for but there is no feature available in versions from EntityFramework to 6 is the use of unique keys ( unique keys ). Including users asking how to create such a control and the incredible is that a...
asked by 09.05.2014 / 23:23
5
answers

Validate model before entering bank

I'm developing a WebAPI using EntityFramework6. Before performing an INSERT in the database, I would like to validate the model that is coming via the request (I believe it is fundamental), but I do not have experience with good data validati...
asked by 09.02.2018 / 16:07