Questions tagged as 'entity-framework-core'

0
answers

How to retrieve UserId in ASP.NET Core Identity - in a class library

I'm using ASP.NET Core 2.0 and Microsoft.AspNetCore.Identity 2.0.1 In a class, actually in context, I need to retrieve the logged-in user ID. in the old one, I would: var userId = User.Identity.GetUserId(); Now in ASP.NET CORE, if I...
asked by 26.01.2018 / 17:19
1
answer

Maintaining ComplexType creation pattern in EF Core

Previously I used the Entity Framework 6.0, and when creating a class as in the example below: public class Produto { public int ProdutoId { get; set; } public string NomeProduto { get; set; } public atributo atributo { get; set; }...
asked by 06.12.2017 / 03:23
1
answer

Correct way to use two contexts in asp.net core with entity framework core

I'm trying to apply what I've been studying and I've caught up with a few contexts. What I'm trying to do is to use the Microsoft Identity structure with my application entities. Structure of solution : - BaseFull.Web - BaseFull.Enti...
asked by 29.08.2017 / 21:37
1
answer

C # - I can not map HERIT with the Entity Framework Core - Code First?

I am not able to map the Person and Client classes ( Table Per Type ( TPT ) using Entity Framework Core ), which Client inherits from Person. How do I do it? public class Pessoa { public int PessoaId { get; set; } }...
asked by 25.07.2017 / 23:14
0
answers

How to use EF Core with inheritance correctly and capture foreign key objects?

I'm using the Entity Framework Core, and I have a template that uses inheritance. I use the TPH (Table Per Hierarchy) standard that maps me all classes of the same super class in the same table and uses a discriminator column to distinguish them...
asked by 10.03.2018 / 14:57
1
answer

Foreach in razor with Many to Many relationship model in the Entity Framework Core

I have a table of funcionário and a table of projeto related many to many as shown in the diagram below: OnthecontrollerFuncionariosControllerintheDetalhesmethodIwanttolistthelistofprojectsthatareinvolved.Inthemethodpopuloamodelan...
asked by 04.10.2016 / 04:44
1
answer

DropDownList with SelectList Item

Personal I'm trying to create a Select List, but in case it's returning this to my view:    Microsoft.AspNetCore.Mvc.Rendering.SelectListItem so it is not returning the Cargos that are in my database and here are the codes I...
asked by 29.11.2018 / 18:24
1
answer

Entity Framewor Core Database.SetInitializer [closed]

Does Entity Framework Core have Database.SetInitializer() ?     
asked by 24.05.2018 / 14:13