Questions tagged as 'entity-framework'

1
answer

How to map an enumerator using EntityTypeConfiguration of Entity Framework 6?

Good evening, I have my next class public class Endereco { public string Bairro { get; set; } public string Cidade { get; set; } public EUF Estado { get; set; } } and my enumerator public enum EUF { SP = 1, PR = 2,...
asked by 17.04.2014 / 00:32
3
answers

Delete record from link using Entity Framework

Good morning. I'm working with Entity Framework and I'm having trouble updating a relational table. For example, I have a product with several categories, in the edition I unlink the category x of the product. The update does not delete the unre...
asked by 25.06.2015 / 15:06
1
answer

Error calculating difference between dates in Entity with Linq to Entities

Before this was my expression: var resultado = db.T_CRM_StatusPDV .Join(db.T_PDV, t1 => t1.DE_Cnpj, t2 => t2.CNPJ, (t1, t2) => new { t1, t2}) .Where(dt => (TimeSpan)((dt.t...
asked by 06.06.2014 / 21:10
2
answers

Left Join with three or more tables with lambda

I have the following query in SQL : select e.idEstado, e.txtNomeEstado, e.txtSiglaEstado, c.idCidade, c.txtNomeCidade, de.txtH1, de.txtTitulo, de.txtDescricaoEstado, de.txtDescription from tbDescricaoEstado de left join tbCidade c on de....
asked by 14.12.2017 / 13:56
0
answers

Error instantiating Context with Entity Framework

I'm getting the Entity Framework to learn, but when I run my code, it returns the following error:    System.TypeLoadException: 'Inheritance security rules have been   violated by the type: 'MySql.Data.Entity.MySqlEFConfiguration'. The types...
asked by 07.11.2017 / 00:37
2
answers

EntityFramework AspNet Core migrations

Good evening, I came across a problem updating the DB of an AspNet Core application. I had created the database, but I ended up deleting it now when trying to create it again using the following commands: dotnet ef migrations Initial dotnet e...
asked by 17.02.2017 / 02:00
0
answers

use SqlDependency with [ORM]

I'm developing a service that should perform a procedure whenever a record as a given condition is inserted into the database. However, although you are using SqlDependency , I am not using SqlCommand , it is running and then disc...
asked by 30.03.2017 / 20:33
1
answer

How to delete objects from a list?

I have the following code: using (Context contexto = new Context()) { List<Cliente> listCliente = contexto.Cliente.Where(x => x.Status == 0).ToList(); } How do I delete this result from the database? Remembering that I have num...
asked by 13.06.2017 / 15:03
1
answer

How to display 2 DB tables within a DataGridView in the application?

I have an application developed C# using the Windows Forms project that displays the Database People Table in a list in the DataGridView field. However I need to display in the DataGridView also the Endereco ta...
asked by 16.08.2017 / 13:08
2
answers

Problem with ValueObject in the Entity framework

I'm having a difficulty with a mapping and would like to know if it's possible to do this: I have a Contact class with two fields that are ValueObject of type "Phone", the fields are Phone and Cell. public Telefone Telefone { get; set; } pu...
asked by 06.04.2016 / 18:41