Questions tagged as 'entity-framework-6'

1
answer

EntityFramework 6 + LazyLoadingEnabled + using ()

I need a help. My problem is this: I can not return the items of my object. Follow my code for review. Client Class public partial class Cliente { public Cliente() { this.ClienteEndereco = new HashSet<ClienteEndereco&g...
asked by 22.05.2015 / 16:55
1
answer

How to update a datagridview automatically?

I've created an application that will display the data of a given view in a datagridview control. The whole application is ready: loading the data, the button to update and also the events load and activated . Technologie...
asked by 24.05.2016 / 22:24
2
answers

Inheritance Modeling MySQL and C #

I am having a question about modeling a DesktopApplication system in C # with MySQL. Essentially I will have the Client, Supplier, PF and PJ entities. PF can be a customer or supplier. And PJ can also be a customer or supplier. My goal is to...
asked by 09.03.2016 / 20:24
2
answers

Entity Framework | Double property that allows null

My property allows values double and values null . In the SQL Server Database it is set to decimal(18, 2) . But when seto some value (ex: 5.00 ), it gives the error below. Error:    The 'Valuation' property...
asked by 29.03.2017 / 23:15
1
answer

Doubt with EntityFramework CodeFirst

I'm starting in the Entity Framework and am having a question regarding CodeFirst . Why do I have to use as virtual some properties like the example below? [Table("Grupo")] public class Grupo { public int ID { get; set; } [Required(Erro...
asked by 11.08.2015 / 23:25
2
answers

Why when I delete or edit table record x is also removed from table y?

I have a system in ASP MVC with C # entity . I have the table Pedidos and Agenda . In the agenda table I have a column with id of the request. When the request is canceled, I have to remove from the...
asked by 04.11.2016 / 15:29
1
answer

How to map a TIME-type column in Entity Framework 6?

I'm using this mapping for a DATETIME field of SQL Server: Property(X => X.DatNascimento).HasColumnName("DAT_NASCIMENTO").HasColumnType("datetime"); But I have another TIME field that I do not know how to configure: Property(X => X....
asked by 05.06.2015 / 15:45
1
answer

Error entering data into bank, EF 6

I'm trying to insert data into the database, but I have an error doing saveChanges(); after doing context.add() several times, it's happened after 500, 2200, and 5500 times. Error: The transaction associated with the current...
asked by 16.10.2015 / 22:00
1
answer

How to test an asp.net mvc controler using Moq and Entity Framework 6

My controller: [Authorize] public class DominioController : Controller { private IDominioDB _db; public DominioController(IDominioDB db) { _db = db; } // GET: Dominio publi...
asked by 06.10.2015 / 03:09
1
answer

Entity Framework 6 error while logging the SQLs

I am trying to see the SQLs executed by the Entity Framework, I use version 6. I'm following this guide . I made a new DBContext using the graphical interface. 5 tables only. The code is inside a Controller Web API2: public class TAG...
asked by 17.06.2015 / 14:52