Questions tagged as 'entity-framework'

1
answer

How to implement a Person repository function for the Generic repository - Asp.net MVC and EF Core

I have a function to return the highest value of an ID field from a table using EF Core. But I'd like to implement it in my generic repository to be dynamic and to be used by all classes. How do I do this? //Funcionar no Repositório de Pessoa...
asked by 18.08.2018 / 13:23
1
answer

String in Entity Expression C #

I need to make a dynamic query similar to the example below String tabela = "NomeTabela"; Var x = db.("NomeTabela").ToList(); Something like that where the table name will change as needed.     
asked by 08.09.2018 / 13:37
1
answer

Entity Framework Code-First - AutomaticMigrationsEnabled

I am learning Code-Fist and I came across the following situation: I am using AutomaticMigrationsEnabled = true so that the database data is synchronized with the classes. But the changes I make in the class will only update the databa...
asked by 14.07.2018 / 00:40
1
answer

C # - EF Core questions to create relational model

I'm starting in Asp Net Core and I have the following question: I have a Curso template and a Unidade template, a course has multiple units, and that unit can belong to more than one course. I did the individual Course and Un...
asked by 04.09.2018 / 20:29
1
answer

Is it possible to use the entity framework from a class library?

I usually use the entity framework in an MVC project but I would like to know if I can use it from a class library project     
asked by 03.06.2018 / 22:34
2
answers

Register a user "admin" when running the application c # mvc

Good afternoon, I need some idea for a web system to automatically create a user Admin as soon as I run (open) the application. That is, when running the application with a zeroed bank, so that I do not have to register any users before loggi...
asked by 05.06.2018 / 19:29
1
answer

DDD + Entityframework + Migrations + SQL Server

Hello, I have a Solution that I am implementing the DDD architecture with Entityframework, migrations and SQL Server! However, I am not able to connect to my local database when performing the migrations command: 'Updata-database'! I believe tha...
asked by 09.05.2018 / 23:51
1
answer

ASP.NET EntityFraord - Grid with Paging

I'm building an asp.net application using entity framwork. To load the grid I use the following instructions: var lista = entity.Usuario.ToList().OrderBy(x=>x.nome); grid.DataSource = lista; grid.DataBind(); But w...
asked by 09.05.2018 / 17:07
1
answer

EntityFramework + Sql Server + ASP.NET MVC

Hello, I have an ASP.NET MVC application that is using the ORM EntityFramework to communicate with a SQL Server database! Currently I switched to a computer and had to install everything again, Visual Studio, and SQL Server Management. But whe...
asked by 05.05.2018 / 00:25
1
answer

Problem when changing entity with E.F and Dapper [closed]

I have a Dapper query, where I search for an entity: var fatura = ObterPorClientedEDataVencimento(cobranca.ClienteId, cobranca.DataCobranca); The Method and properties of my entity are in this Gist , I put it there just so the questio...
asked by 22.03.2018 / 12:50