Questions tagged as 'entity-framework'

2
answers

Make a foreach inside a cshtml (view) from a controller

I made a code using Linq and jQuery . It turns out that it is giving me a problem that I can not solve, which is to dynamically create a Treeview . Then I had another idea. Make foreach direct in View (cshtml). Here's the question,...
asked by 11.09.2014 / 18:53
1
answer

Select in two tables

Ban.cs public partial class Ban { public int IdBan { get; set; } public System.DateTime DataBan { get; set; } public System.DateTime DataDesban { get; set; } public int Usuario_IdUsuario { get; set; } p...
asked by 02.11.2014 / 20:21
1
answer

Left join in linq is giving error in more than two table

I made this link: var resultado = ( from pdv in db.T_PDV join tarefa in db.T_TarefaParceiro on pdv.CNPJ equals (tarefa.CNPJ) into _trf from g1 in _trf.DefaultIfEmpty() join parceiro in db.T_OsParceiro on tarefa.IDTarefaParceiro...
asked by 13.06.2014 / 21:32
1
answer

Update edmx file is not working

Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including showing the table to be updated or the fields. He makes no mistake, he proceeds as if everything is fine. But when I conclude, it does not chan...
asked by 26.05.2014 / 03:13
1
answer

How to return the value of an Entity Framework field C #

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using AuditContatos.Dados; using...
asked by 02.04.2014 / 15:46
1
answer

Why is the Entity Framework generating a new record in the database? [duplicate]

Next, I'm working on a new project asp.net-mvc , and I have 3 classes. public class Anuncio { public int AnuncioID { get; set; } public string UsuarioID { get; set; } [Required] [MaxLength(255)] [Display(Name="Título")...
asked by 01.04.2014 / 19:45
0
answers

Eager Loading EF Core 2.1 Load only First Level

Well, I need a lot of help! I'm having a C # WebAPI project as per PRINT below: The problem is this: I need to access the data of navigation properties created by EF Core 2.1 DBFirst, but only the first level! What is happening is that...
asked by 02.01.2019 / 19:41
2
answers

Error using store procedure - Entity

I used a store precede for authentication in my application as suggested ... insert the link description here But now you're giving the following error ...     
asked by 18.07.2014 / 01:42
1
answer

Insertion 1 for many is recording two records in the bank

I have the following classes: Usuario , Noticia , Bloco and Editoria . I had a One to Many relationship between the tables Noticia and Editoria , Noticia and Bloco . It works perfectly, b...
asked by 19.07.2014 / 02:05
0
answers

Entity Framework 6 get attributes in SaveChanges

I am using Entity Framework 6 with Oracle . The database is from a legacy system, so I plan to set the primary registry keys on hand. To make life easier, I want to get the SaveChanges of DbContext data from the tab...
asked by 11.12.2018 / 17:43