Questions tagged as 'entity-framework'

1
answer

Stored Proc X Entity - Is it a good decision?

On Entity Framework days, doing an MVC project using Stored Procedure is a good way? I've always heard this: If you choose EF, it does not make sense to use SP, but I've heard people say that this is not necessarily an absolute truth. Then comes...
asked by 29.06.2015 / 15:06
2
answers

Why can not I query for an object added before SaveChanges?

I need to add multiple objects to the database and some objects need another specific object that I've added earlier. When I make a query to get the object, it comes null. Example: var subItem = new SubItem { Valor1 = 1, Valor2 = "...
asked by 25.09.2014 / 20:01
2
answers

Problems with slowness SQL LINQ C # Entity FrameWork

I'm using Entity frameWork, I have a list of objects (data taken from the database) with Client data, public virtual DbSet<clientes> clientes {get;set;} public IEnumerable<clientes> FindAll() { db.Configuration.LazyLoadingEnabl...
asked by 06.11.2015 / 22:13
2
answers

How can I do to get the insert in the log with logged in user? Identity - Asp.net core 2.0

I need to get the user logged in, to do an insert in the log, thus including which user included in the table, made change, and delete. I'm learning language, and I still have a lot of questions. This is my AccountController controller: pri...
asked by 10.07.2018 / 16:50
1
answer

Modeling - Model

I'm having trouble creating my models. Let's imagine that I have 4 different types of products (Here like A, B, C and D) public class Produto { public int ProdutoId { get; set; } public TipoProduto TipoProduto { get; set; } //enum t...
asked by 24.08.2017 / 21:16
2
answers

Help with LINQ, query in .Net

Good morning, guys, I'm in need of help with LINQ. I'm trying to perform the following query through linq: SELECT NFE_SAIDA.NFESAI_SEQUENCIA FROM CAD_NFE_SAIDA NFE_SAIDA LEFT JOIN CAD_NFE_SAIDA_ESTACOES NFE_SAIDA_ESTACOES ON NFE_SA...
asked by 29.12.2017 / 11:37
1
answer

Edit object with related objects

I have an object Cliente that relates to two other objects. [Table("Cliente")] public class Cliente { [StringLength(100, ErrorMessage = "Este campor permite apenas 100 caracteres"), Required] public String Nome { get; set; } ......
asked by 08.05.2017 / 14:23
1
answer

Inserting and updating data in N-N tables (many for many)

I'm having trouble saving in a many-to-many relationship, follow my template: public class Pessoa { public int id { get; set; } public string descricao { get; set; } public ICollection<Conta> Conta { get; set; } } public cl...
asked by 02.02.2017 / 20:50
1
answer

Query using Entityframework Why performance variation?

I have the following querys using Linq to Object: _Context.GerenciaTransacao.Where(x => x.Placa == "LUN1320").ToList(); In this query, results return in 100ms. and string placa = "LUN1320"; _Context.GerenciaTransacao.Where(x =>...
asked by 14.02.2017 / 15:59
1
answer

I want to fetch information from a table with EF [closed]

I have the following form code: @model Domain.Entities.Tabela1 @using WebUI.HtmlHelpers @using WebUI.Extensions @{ ViewBag.Title = "Tabela"; Layout = "~/Views/Shared/_Master.cshtml"; } <article ng-app="registrationModule"> &l...
asked by 30.06.2017 / 13:07