Questions tagged as 'entity-framework'

1
answer

How to make the Mapper module in EF?

How to make the Mapper module in EmptyFramework 1 for n in two two tables? Tabela 1 - clienteID - nome - endereçoID Tabela 2 - EndereçoID - rua - bairro - cidade     
asked by 04.07.2017 / 14:40
2
answers

Entity Framework - Rename ForeignKey

I have the classes: [Table("Editora")] public class Editora { [Key] public int EditoraID { get; set; } public string nome { get; set; } public List<Livro> livros { get; set; } public Lis...
asked by 13.06.2017 / 01:07
1
answer

Error in FK when running Migrations in C #

I have the following scenario public class branch() { public Branch() { Branchs = new HashSet<Branch>(); } [StringLength(80)] public string Description { get; set; } [Required] [ForeignKey("TypeDeliv...
asked by 19.06.2017 / 18:58
1
answer

Relationship in table with Include does not work

I can not make my parent table include the dependent: var medicos = TabelaMedico.Include(m => m.Especialidade).ToList(); It displays the following error message:    CS1660: Can not convert lambda expression to type 'string' because it...
asked by 27.07.2017 / 18:54
1
answer

Migrations adds the letter S to the table name

I have a model: public class pimentel { [Key] public int id { get; set; } public string cod_item_Crm { get; set; } public string tag { get; set; } public string data_anal { get; set; } public string modelo { get; set; }...
asked by 24.07.2017 / 19:12
2
answers

Strange behavior in EntityFramework with StoredProcedure?

I'm performing a search through StoredProcedures in EntityFramework and the Data field is displaying conversion error to type String . Method public IEnumerable GetFilteredList(ConsultaBanner filtro) { st...
asked by 01.06.2017 / 14:51
2
answers

How do I put the usermanager property to be started in my Model

I would like the form Name to be filled in automatically by the username of the logged in user. How do I include this property in my Model ? public class Condominio { public int CondominioId { get; set; }...
asked by 16.05.2017 / 23:38
1
answer

Update Many To Many Entity Framework

I'm having trouble updating with many to many relationship. I want the update method to update all fields of the itemEntity as well as the providers. For example, I just put the description field and vendors according to the screen image....
asked by 26.05.2017 / 16:19
1
answer

Relationship 1: N with EF

I have a table of units as below: public class Unity { public int Id {get;set } public string Name{ get; set; } } public class UsersRight { public int Id {get;set } public string Name{ get; set; } public int Value{ get; set; } }...
asked by 24.03.2017 / 16:36
1
answer

Insert data with related objects

I'm trying to insert an containing object that has a relationship. User > Company First of all I need to get the UserID data in the% Create % public ActionResult Create() { var usuarioLogado = User.Identity.Name; var usuario...
asked by 10.01.2017 / 22:25