Questions tagged as 'entity-framework'

0
answers

How to hide properties of an ASP.NET Core model entity only in JSON rendering?

I'm starting studies with ASP.NET core Web Api, and I'm implementing the User class, which has a Password property. Of course I do not want the password to be visible in aps JSONs. I have been researching a lot, I read about IgnoreDataMember,...
asked by 15.12.2017 / 19:28
0
answers

Error saving data with EF

I'm setting up my unit tests and tried saving the data to a table using the Entity Framework, but at the time I run it returns an error.    Validation failed for one or more entities. See   'EntityValidationErrors' property for more details....
asked by 24.11.2017 / 11:52
0
answers

Error: The entity types 'CustomRole' and 'AspNetRoles' can not share table 'AspNetRoles'

I've created the entire Identity structure to work with INT instead of GUID. Using DataBase First and included in the database, with a create script, the Identity tables modified (just changed AspNetUsers). but every time I call: userManage...
asked by 22.11.2017 / 23:25
0
answers

Adapt IDBSet EF6 to EF Core

I'm migrating from EntityFramework 6x to the core EntityFramework, but I'm catching up a bit to implement an IDBSet interface that does not exist in EF Core. In its place, I need to use something like MyContext.Set ... but I do not know how to d...
asked by 15.11.2017 / 20:09
2
answers

EF Core Relationships one-to-many-to-many FluentAPI

Good afternoon, I would like to ask a relationship question in Entity Core. I have a person table and the person has a position (Manager, supervisor, responsible, etc ...) public class Pessoa { public int PessoaId { get; set; } public...
asked by 28.10.2017 / 21:27
0
answers

ASP.MVC ENTITY Code First (strange problem)

I do not know if I'm doing something wrong (probably yes). But EF is persisting the data in a DB and in a table that it creates alone. I've already repeated this step-by-step 2 times and the result is the same. 1-I create an MVC Web Soluti...
asked by 03.11.2017 / 19:00
0
answers

static dbContext with Entity Framework: Compensates or not?

Well, I use the Entity Framework and Code First to manage my data access, and I'm thinking of working with a single, static, global instance of my DataBaseContext. But I have two questions: What problems could occur with this type of usage?...
asked by 23.10.2017 / 18:45
0
answers

Access FK attribute in Framewokr entity

I have the class Cliente which has a IList<Produto> and the produto class has a ClienteId (which is the FK) and a Cliente Cliente { get; set; } attribute. How do I access the Nome attribute of C...
asked by 16.10.2017 / 23:26
0
answers

1: 1 relationship with abstract class in EF

Okay, everyone? I have the following problem: I have two Person and Property classes that may have an address, but the < strong> Person can have 0: N Address and Property 0: 1 . Knowing this I've transformed the Address class into...
asked by 12.10.2017 / 20:41
1
answer

Why does the one-to-many relationship in the Entity Framework default default work?

[Table(name: "cliente", Schema = "estudo")] public class Cliente : Base { [Key, Column("COD_CLIENTE")] [Required] public override Int64 Id { get; set; } [Column("CLI_NOME")] [Required] public virtual String Nome { get; se...
asked by 14.10.2017 / 20:23