Questions tagged as 'entity-framework'

2
answers

ENTITY FRAMEWORK - make a query like SQL type

Personal Speech, I have a problem that may be not doing correctly, I have a query in a description field of a table eg    Select description table where field like 'test% description' How do I do this with entity framework? because if...
asked by 24.10.2017 / 19:58
1
answer

Help to write to USERS and AspNetUsers at once

Help please. I lost all day redoing various parts of the system, trying a lot of different solutions but I ended up with no ideas. I have a multi-application solution. One of these applications (where I try to isolate data persistence) has th...
asked by 21.11.2017 / 23:21
1
answer

Declare Relationship Entity Framework one to many

I have two classes: Person public class Pessoa { public int Codigo { get; set; } public string Nome { get; set; } .... public virtual ICollection<Endereco> Endereco { get; set; } } Address public class Endereco {...
asked by 26.10.2017 / 20:05
1
answer

Error CS0012 The type 'Client' is defined in an assembly that is not referenced

Class manipulation with EF: ContextEF Contexto = new ContextEF(); public List<Cliente> Listar() { //var query = from c in Contexto.Cliente // select c; return Contexto.Cliente.ToList() ; }...
asked by 25.09.2017 / 23:52
1
answer

Dependencies with EntityFramework C #

My question is how to use the state class include for parents because the city class has no parent connection. How can I accomplish this sql loading dependencies? private void FrmCidade_Load(object sender, EventArgs e) { var registros = Co...
asked by 15.09.2017 / 17:26
1
answer

EntityFramework DatabaseGenerated

I have a property in my model where it automatically generates the Id when it is inserted in Db, but I have a specific case where I need to put the Id manually, is there any way to prevent EF from generating the automatic Id if I create and send...
asked by 12.09.2017 / 16:11
1
answer

Entity delete table and its relationships

Is there any way to delete a table record and all of its relationships at once? because I currently delete each related record before deleting the main record, and this takes a lot of time, for example I have the table Note and I want to delete...
asked by 02.10.2017 / 21:34
1
answer

Error trying to save information to the database through the Entity Framework

My project has the following classes: public class Manifestacao { public long Id { get; set; } public string NumeroChamado { get; set; } public virtual Cliente Cliente { get; set; } public virtual List<Conteudo> Conteudo...
asked by 04.10.2017 / 16:12
1
answer

Error loading database information into a datagridview through the Entity Framework

My project has four classes: public class Manifestacao { public long Id { get; set; } public string NumeroChamado { get; set; } public string DataHoraReg { get; set; } public Cliente Cliente { get; set; }...
asked by 30.08.2017 / 20:16
1
answer

Class Mapping with FluentAPI and Entityframework C #

Parent, State, City Table A country can have several states and a state can have only 1 country;    State-> Country: 1: N A city can have only one state and one state can have several cities.    City | State 1: N       I would like...
asked by 22.06.2017 / 17:24