Questions tagged as 'entity-framework'

1
answer

Something wrong with references using two layers in the Entity

I made an example in Entity 5.0 and with 1 layer worked perfect. Now I have separated in UI and DA L, but this is giving error. The same page that worked on the DAL layer when done in UI is giving error. I t...
asked by 20.03.2014 / 18:10
1
answer

Controller and View Structure

An aid to not doing something much more laborious than it can be soon of face. I have the following classes in my Model : public Pessoa { public int Id { get; set; } public int TipoPessoaId { get; set; } public string Nome { get;...
asked by 31.03.2014 / 20:43
1
answer

I can not insert into DB with entity

This is my embed code. Why does it make a mistake? What should I do? public int abreOsParceiro(string os, string cnpj, string dataAbertura, string dataVisita, string tecnico) { WEBEntities db = new WEBEntities();...
asked by 26.05.2014 / 21:13
1
answer

How to pass a string value to a type in Entity

In my entity mapping, the fields that are FK look like this: public virtual T_Acao T_Acao { get; set; } public virtual ICollection<T_OsParceiro> T_OsParceiro { get; set; } public virtual T_ProximaAcao T_ProximaAcao { get; set; } In my...
asked by 02.06.2014 / 21:23
1
answer

No insert in the table is inserting everything, even what I do not want

When I give savechanges() , it writes to all tables and I would like only one. How I do? The Acao and ProximaAcao tables also inserts log. public T_TarefaParceiro geraIdParceiro() { WEBEntities db = new WEBEntities();...
asked by 02.06.2014 / 22:28
1
answer

How to create an extension method for the type of a class in VB.NET

I'm creating an MVC framework that will work similar to the Entity Framework inside a VB.NET project where I've created an attribute called TableAttribute that will set the table name and the schemas to the model , like this: Namespa...
asked by 25.10.2018 / 17:06
1
answer

How do you model 1x0..1 relations (optional one-to-one) in the Entity Framework Code First?

When an Entity MAY have one (and only one) instance of another Entity, but the second Entity MUST have the first, how is Entity Modeling done?     
asked by 31.01.2014 / 19:50
3
answers

How to do Update in Linq?

My project has the Delete method, but it definitely deletes the record from the table in the database. I would like to instead of delete, change the column record, I have a field called "Status", this field is an Enum with two options "Enable...
asked by 09.11.2018 / 16:34
1
answer

Error System.Data.Entity.Infrastructure.DbUpdateConcurrencyException while doing update with entity

Good morning. I need to do an update via entity and it accuses me of the following error: System.Data.Entity.Infrastructure.DbUpdateConcurrencyException: 'Store update, insert, or delete statement affected an unexpected number of rows (0)....
asked by 01.08.2018 / 13:43
2
answers

WebApi Token C # Auth

I am issuing a token, but at the moment making a request with the token, returns the following message:    "Message": "Authorization has been denied for this request." I am passing user and static password File: startup.cs private...
asked by 04.10.2018 / 17:04