Most voted "entity-framework-6" questions
It is a set of ADO . NET technologies that supports data-driven application development.
Learn more…371 questions
Sort by count of
-
3
votes1
answer672
viewsDbupdateexception exception
I am trying to study EF with Code First. I am getting this exception on SaveChanges() An unhandled Exception of type System.Data.Entity.Infrastructure.Dbupdateexception occurred in…
-
3
votes2
answers234
viewsAdding Text Box and Writing to Database. (with C#, entityframework 6.1.3)
I am doing a project in Visual Studio 2013, with Entityframework version 6.1.3, MVC 4.5.0.0 and using Viewmodel. I am programming a page that is called payment condition. The creation page will have…
-
3
votes3
answers1778
viewsScaffolding error during View generation
I am creating a new project using EF Power Tools and I have the following error: Error There was an error running the Selected code Generator: 'A Configuration for type 'TST2.Models.Course' has…
-
3
votes1
answer77
viewsEntity Framework - Data Access Tips
I am working on a project using EF6 with C#, in one of my classes I have to save a file, example below: public partial class Arquivo { [Key] public int ArquivoID { get; set; } public string Nome {…
-
3
votes2
answers305
viewsBest way to recover data for a Datagridview?
What is the best way to recover data from a direct table to a Datagridview ? I have several doubts, because, many people do not recommend using Unitofwork which makes it much easier and leaves the…
-
3
votes2
answers616
viewsDynamic Connection EF C# Windows Forms Mysql
I have the following problem: EF creates a connectionString in the app.config and uses this connection always, but if you need to change the database server I will have to change the app.config. I…
-
3
votes1
answer269
viewsHelp with Action Edit and Delete returning null
I am developing an application but I have a problem with Edit and Delete actions. I have looked at the code several times, but calling the cited actions shows the following error: The Parameters…
-
3
votes1
answer132
viewsHow to simplify declaration of types with Entity Frameowrk?
I have some tables with several fields of type datetime, and for all of them I need to create a validation in Onmodelcreating() for this type, IE, I need to define .HasColumnType("datetime");, my…
-
3
votes1
answer114
viewsIs it a problem with my architecture?
I’ve been a software developer for a long time, but I’m always looking to learn "different ways of doing things". I am currently working on a new project and decided to base the architecture on…
-
3
votes1
answer828
viewsA specified Include path is not Valid. The Entitytype 'Model.User' does not declare a navigation Property with the name 'Connections'
I’m following this example to maintain connection and user information in a database. So I created 2 tables: dbo. User: dbo. Connection: These 2 tables above are very simple. I only created as a…
-
3
votes1
answer69
viewsHow to identify the Entity that throws the error when saving?
In my application, with Entity Framework, I make a query in a Round entity: var lista = contexto.Rodada.Where(condições); Then I’ll go over that list with a foreach. During iteration "updates" and…
-
3
votes1
answer272
viewsDynamic attributes of an Entity Model
I have a Procedure which returns a number of columns dynamic, because this precedent uses the function Pivot, then the question arises: How to create a Entity Model for this project ?. Example:…
-
3
votes1
answer845
viewsEntity Framework with Oracle
I am trying to use EF, using Code Frist, along with an Oracle database, for this I am using the Nuget package Oracle.ManagedDataAccess.Entityframework, but whenever I try to run the Update-Database…
-
3
votes1
answer375
viewsASP.Net MVC application with Jquery Bootgrid does not load data
I created a very simple application (customer registration) using ASP.Net MVC 5 + Entityframework 6 (codefirst) + Mysql database. Using as main component the Jquery Bootgrid for data handling. It…
-
3
votes1
answer100
viewsWhat precautions should I take when creating tables with 1:1 relationship?
Basically I’m in doubt about when I should use 1:1 relationship or a large table. In my case I would have the object public class Person(){ public Guid Id {get;set;} public string Name {get;set;}…
-
3
votes0
answers113
viewsHow to use interfaces like Dbset’s in the C#Entity Framework
Hello, I’m making a solution where my entire business layer is in a separate project and in this project I created the layer relational structure from interfaces as shown in the example below: //…
-
3
votes1
answer251
viewsError running Entity Framework
I am starting my studies in EF, following this tutorial, I made up to 22 min of the video, then when I will run: System.Typeinitializationexception: 'The 'System.Data.Entity.Internal.Appconfig' type…
-
3
votes1
answer91
viewsHow to deal with business rules?
I am working on a C# WPF + EF6 application and find myself lost when it comes to reusing business rules. I’m using the standard repository + Unit of work, but I believe that copying-pasting complex…
-
2
votes1
answer82
viewsHow to declare unique key fields with Entityframework?
Something that many seek but that there is no feature available in the versions of EntityFramework until the 6 is the use of unique keys (Unique Keys). There were even users asking how to create…
-
2
votes1
answer2497
viewsCkeditor with MVC5 and EF6
I put the Ckeditor in my project. It works fine, but when I click the button Save it returns Essee error: A possibly dangerous Request.Form value has been detected in the client (Content="<p>…
-
2
votes1
answer250
viewsHascolumnname does not recognize field
I am working with Entity Framework 6.1, using the approach code first. I mapped my class in the database through the class EntityTypeConfiguration. When mapping a property with a table field, using…
entity-framework-6asked 10 years, 8 months ago dhielyton 63 -
2
votes1
answer136
viewsAuthentication, email / password and knowing which bank is correct
The idea is a Saas application. Where there will be only 1 single deploy. and customers will be separated by bank Once this is done, there will be a login screen, where login(email)/password is…
-
2
votes1
answer2238
viewsError in the query
I’m trying to make a query in the table below, from my database. This query is performed through the method below: public void compraAcoes(float cepf, string codigo, int quantidade) { string cd =…
-
2
votes1
answer321
viewsFluent Mapping or Data Annotations?
I was watching a video class on ASP.NET MVC, when I watch the Fluent Mapping of the Entity Framework for the first time. Then the doubt came to me. Which of the two is best recommended? Fluent…
-
2
votes1
answer74
viewsFailure to popular a gridView
I am having problems when displaying a gridView, it is not displaying the right data, it seems that this trying to display vertically, I have already changed the property Gridline to horizontal,…
-
2
votes2
answers803
viewsError 4 The type 'System.Data.Entity.Dbcontext' is defined in an Assembly that is not referenced
I have looked for several solutions to this error on the internet and unfortunately nothing helped me. Can anyone help me on how to fix this mistake?? Error 4 The type 'System.Data.Entity.Dbcontext'…
entity-framework-6asked 10 years, 3 months ago Wallace Carlos 93 -
2
votes1
answer1195
viewsHide Actionlink parameter
For example: /admin/Edit/1006 Is there any way to hide this id? So any malicious user can change the value and end up finding a user. I know you have to check the controller to see if the user can…
-
2
votes2
answers52
viewsList group only that contain items
And an example of model: public class Grupo { public int Id {get;set;} public string Nome {get;set;} public ICollection<Item> Itens {get;set:} } And the items public class Item { publit int Id…
-
2
votes1
answer273
viewsExchange Entity Framework EDMX for Code First
I have an EF5 application 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…
-
2
votes1
answer46
viewsEnable delete
I have my model which has several lists. For example: public class Funcionario { public ICollection<FuncionarioNotificacao> Notificacoes {get;set;} public ICollection<FuncionarioExame>…
-
2
votes2
answers2419
viewsQuery with related data in the Entity Framework
I am trying to bring data of the materials with the data of your relationships with the Unit and TD tables, but this code below does not return anything, if I do without Include() it returns the…
-
2
votes1
answer42
viewsSqlserver 2012 - Column '' in table '' is of a type that is invalid for use as a key column in an index
After seeing this error when creating a NONCLUSTERED index I wondered if it would really be necessary to create this index in the following scenario: I have a table with 11 columns, a column I save…
sql-server entity-framework entity-framework-6 sql-server-2012asked 9 years, 8 months ago Ricardo 5,680 -
2
votes1
answer134
viewsDefault value for Datetime column
I have a table that has the field DataRegistro of the kind Datetime. I am using Entityframework to generate the database (I am not using code first) add the property Computed for the column to be…
-
2
votes1
answer221
viewsApplication Layer
Based that question and that other question, in an environment that uses the Entity Framework and Asp.net MVC. I see in many examples the non-use of the application layer, a use of the data layer…
asp.net-mvc software-architecture entity-framework-6 software-engineeringasked 10 years, 4 months ago Diego Zanardo 3,301 -
2
votes1
answer60
viewsIf there is update a table and insert into another, if not, insert into the two
How to make an expression using EPH so that when a certain list of objects is sent and already exists in the database, it is updated and the change is inserted in another historical entity,…
-
2
votes1
answer158
viewsWhat is the correct way to declare the following class structure and get the respective Entityframework behavior?
I have the following class structure: public class Revenda { [InverseProperty("Revenda")] public virtual ICollection<UsuarioRevenda> Usuarios { get; set; } } public class Empresa {…
c# entity-framework pattern-design asp.net-identity entity-framework-6asked 10 years, 4 months ago user8052 -
2
votes1
answer79
viewsList most frequent items in the database using LINQ
I would like to list on the screen, like a ranking, the most frequent items in the database table through its name, for example: John appears 6 times; Joseph appears 4 times; Mary appears 1 time.…
-
2
votes1
answer187
viewsProblem accessing List from a query
I’m starting today with Entity-Framework but I came across a problem that I believe is simple, but I couldn’t find the answer anywhere, perhaps because I’m not sure what to look for. The code is as…
-
2
votes1
answer109
viewsProperty containing only the Keyattribute attribute resulting in auto-increment column in the database
If I’m not mistaken, this must have come in version 6.1.1 of Entityframework and it wasn’t like this in previous versions. I believe a column only became auto-increment when the attribute…
-
2
votes1
answer493
viewsEntity Framework: Error creating the database
I am using EF6 and I have a problem using the command Update-Database -Verbose -Force. From the following error: PM> Update-Database -Verbose -Force Using StartUp project…
-
2
votes1
answer238
viewsRemote validation preventing data editing
I am using remote validation to prevent repeated emails in the database, which works well, when I do some registration. The problem is that the remote does not accept the original registration…
-
2
votes1
answer70
viewsRemove serial column creation Entityframework + Npgsql
Ola, I am creating an application using Fluent API + Entityframework. But in my domain classes when determining that a property is PK it automatically defines it as serial, I would not like to get…
-
2
votes2
answers1291
viewsWhat is READ_COMMITTED_SNAPSHOT?
What is READ_COMMITTED_SNAPSHOT EF6 Transaction Support About Anyway? What is your use within the Entity Framework?
.net entity-framework entity-framework-6 terminology software-engineeringasked 8 years, 2 months ago Marco Souza 12,304 -
2
votes1
answer102
viewsCalculated field with RU
I have two classes : public class Cliente { public int Id {get;set; public string Nome { get; set; } public string Email { get; set; } public string Telefone { get; set; } public string Celular {…
-
2
votes1
answer2765
viewsEntity Framework Left Join
Seeing the question Left Join with lambda Groupjoin and with condition, I have doubts about the way I do Left Join with Linus Having the following entities public class Cidade { public int CidadeId…
-
2
votes2
answers1466
viewsEntityframework complaining of Identifier duplicity even with the property being null
I have the following classes: Product: public class Produto { [Key] public int Id { get; set; } [MaxLength(70)] [Required(AllowEmptyStrings = false)] public string Descricao { get; set; }…
-
2
votes2
answers84
viewsError running Savechanges EF6
Before it was working normally. Now I face this problem when running this code: try { db.SaveChanges(); } catch (Exception ex) { //erro aqui } Error message: Exception: Spatial types and functions…
-
2
votes0
answers668
viewsError while updating Mysql.Data
I upgraded Mysql.Data and Mysql.Data.Entity from version 6.9.9 to version 6.10.4 and started getting the error below : Inheritance security rules were breached by the type:…
-
2
votes1
answer60
viewsSumasync return zero
I have an appointment in LINQ where do I use the SumAsync, however when my entity is empty I have the exception: The cast to value type 'System.Decimal' failed because the materialized value is…
-
2
votes1
answer43
viewsQuerry Lazy Loading in EF Code First
It is possible to create a querry Lazy loading using a DbContext What is Eager Loading doing? Is there any way I can specify that Company company = db.Comanies.Find(id); this command does not need…