Questions tagged as 'entity-framework'

1
answer

Error Adding Controller with views using Entity Framework in Asp.NET

When you try to add the following error appears: Model:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;namespaceMVCEntity.Models{publicclassUsuario{publicintId{get;set;}publicStringLogin{get;set;}publicStringSenha{...
asked by 16.04.2018 / 23:45
0
answers

Problems Querying a Record Using the EntityFramework Core

I have a one-to-many relationship between the "Person" and "Person" tables. My idea is to have a People register (Register anyone other than a customer, an affiliate, or a supplier ... just a person). When a person is going to become a customer,...
asked by 11.04.2018 / 23:10
0
answers

Problems returning an IQueryable list to convert it with Automapper

I have a function that returns me a list of people with their personal / legal relationships. I have a PersonViewModel that is already mapped in the Autommapper layer ... When I call the GetJoinAll () function it has to return an IQueryable of P...
asked by 10.04.2018 / 00:39
2
answers

How to use the where clause with linq?

I need to make a join between the person and person tables so that the Entity Framework core brings a corresponding record. I'll be clearer: In the Person Person table, I classify my people record using an enum. I did this to save the Ids of...
asked by 05.04.2018 / 16:55
3
answers

Error ASP.NET MVC

I have this code, working perfectly just the way I want it @using (Html.BeginForm()) { @Html.AntiForgeryToken() <div class="container"> <form class="well form-horizontal"> @Html.ValidationSummary(true, "", new { @cl...
asked by 13.04.2018 / 19:35
1
answer

Doubt to insert record with foreign key. ENTITY FRAMEWORK

I'm a beginner (well, beginner) in programming, and I have a case to develop, which would be a Crud, using ASP.NET (C #) and Entity Framework. I've created a simple contact registration form, where there is a company name field. Contact table an...
asked by 07.04.2018 / 02:24
0
answers

Select set of values inside a LINQ query

Friends, I'm trying to create the following .json with a LINQ query using Entity Framework 6: { "id": "1231-12321-sdff-21-31", "name": "nome do produto", "description": "Descrição do produto" "rating": 4.1, "pr...
asked by 29.03.2018 / 15:58
0
answers

Relate Identity table (AspNetUser) with other table in my application

I am developing an application that uses Asp.Net MVC Identity, I have isolated the Identity part in the CrossCutting layer, and created a layer called Data where I have the Entity Framework where I am mapping other tables that I will use in the (...
asked by 09.03.2018 / 14:29
0
answers

Mock browsing properties

I'm running unit tests on my controllers and I often need to Action return the navigation properties along with the template in question. Example public async Task<ActionResult> AlterarValores(int? id) { if (id == null)...
asked by 02.03.2018 / 13:48
1
answer

Problem creating foreign key in entity

I'm trying to create a primary key composite, so far so good. With this I need to do a foreign key . I have more or less the following scenario (it's a hypothetical scenario but it reflects what I need and my error): public class Keys {...
asked by 01.03.2018 / 19:25