Questions tagged as 'entity-framework'

2
answers

I can not use the Find () method using EntityFramework

I'm using the next tutorial to use the Repository Pattern: Follow my repository class public class Repository<T> : IDisposable, IRepository<T> where T : class { protected readonly EntityContext ctx; public Repository(...
asked by 06.03.2018 / 20:58
1
answer

How does the Entity Framework Track objects?

I have read a number of such questions, but I find my very specific question: How does the entity framework "track" objects? That is, as when loading an object and even without sending the object back to the context class, just calling contex...
asked by 06.03.2018 / 15:54
1
answer

Convert SQL to LINQ

I have the following table CREATE TABLE 'ultimaposicaorastreadores' ( 'Id' CHAR(36) COLLATE utf8_bin NOT NULL DEFAULT '', 'Serial' BIGINT(20) NOT NULL, 'DataGps' DATETIME NOT NULL, PRIMARY KEY USING BTREE ('Id', 'DataGps'), KEY 'serial_idx' US...
asked by 11.01.2018 / 17:32
1
answer

How to instantiate a part of a class with EntityFramework to work with CRUD only on that data

I'm creating a web-based solution in the SinglePageAplication (SPA) type made with AspNetCore and I use the Entity Framework to make my CRUD in the SQL Server database. I am sure that the Entity Framework allows me to do the updates of only what...
asked by 28.11.2017 / 12:17
1
answer

AspNet.Identity Creating user with Role

It's the first time I'm working with Entity and Identity and I'm confused about how my user persists. Basically I have a User table, with several relationships with the database and the Id int) I have the Identity AspNetUsers table and AspNetRol...
asked by 20.11.2017 / 17:52
1
answer

TransactionScope - Problem with Rollback

I need the TransactionScope to rollback if any of these foreach returns error. I added an Exception manually between 2nd and 3rd foreach to test if rollback was working, but the information saved in the 1st and 2 foreach were not...
asked by 23.10.2017 / 21:02
1
answer

Error trying to change a user's role

I'm getting the following error when trying to change the role of a user:    Application Server Error '/'. UserId não encontrada. Descrição: Ocorreu uma exceção sem tratamento durante a execução da atual solicitação da Web. Examine o rastre...
asked by 10.10.2017 / 10:24
1
answer

Eaves view parameter to action

I have a view that list my users, it's basically in the default generated by asp.net mvc with entity, the data is in a table, and inside this table I have one: @Html.ActionLink("Aprovar cadastro", "Aprovar") And I have within the controller...
asked by 08.10.2017 / 03:59
1
answer

Bringing other columns with GroupBy with LINQ

I have two Tables: 1st Process containing ProcessId and SituationProcessId 2nd SituationProcess containing StatusProcessId Description Templates: public class ProcessoModel { public int? ProcessoId { get; set; } public int? Si...
asked by 06.09.2017 / 16:08
1
answer

Entity Framework vs SQL Injection (security?)

Hello! I'm a newbie in development so I'm sorry if the question is silly. If it is thank you link's with references so I can better inform myself. As much as I understand the concept and the use of SQL injection I can not have enough malice t...
asked by 11.09.2017 / 15:52