Questions tagged as 'entity-framework-6'

1
answer

Automated Deploy - Version Maintenance for Multiple Clients

What is the best way to automate deploy? Having 1 deploy for each client, what is the easiest way to keep all of these deploys? database migrations and all version handling? In an example we have 100 clients     
asked by 09.09.2015 / 02:40
1
answer

C # decimal field in Form

Simple question: I have a Decimal field of type Currency in my model. It happens that when I enter a decimal value in the form field, it arrives as integer in the Controller: Example: KM Value Rounded: 0.41 Arrives on Controller: 41...
asked by 18.06.2015 / 03:34
1
answer

How to load only the ID attribute in Many-To-One Relationship in EF?

I have two Many-To-One relationships in this class ( usuario and projeto ): public Atividade() { Projeto = new Projeto(); StatusAtividade = EStatusAtividade.NaoIniciado; TipoAt...
asked by 17.07.2015 / 16:40
2
answers

Set anonymous object property name and resources

I'm using multi-language resources on a system. In a json return I create an anonymous object var resultado = minhalista.Select(x => new { }) But I happen to need the property of this anonymous object to be according to the value of t...
asked by 08.04.2015 / 02:47
1
answer

Global Filters in Entity Framework

I would like all my DbSet to filter all calls That is, I would like all DbSet to do the following filter: Where(x => x.active == true) Without the need of all the time I have to do dbo.Models.Where(x => x Ho...
asked by 26.02.2015 / 20:16
2
answers

Site works on localhost, but not on UolHost (permissions?)

I created a default site (from those that already come pre-encoded from visual studio 2013), using asp.net mvc technology with common authentication for individual accounts. In my localhost the site runs that it is a beauty, it registers user...
asked by 23.11.2014 / 18:24
1
answer

Entity Framework does not update my database

I'm using EF6 And it happens that when I use Update-Database it does not update my database. For example I have my model: public class Cliente { public int Id {get;set} public string Nome {get;set;} } If I add...
asked by 29.01.2015 / 00:44
1
answer

Problem with select in table with relationship many to many

I have the following scenario: public class Pedido { [Key] public int Id { get; set; } public virtual ICollection<ProdutosPedido> ProdutosPedidos { get; set; } public DateTime CreateDate { get; set;...
asked by 06.11.2014 / 21:27
3
answers

How to enable cascade for only one model

By default EF6 is enabled to cascade models, until we use the following convention: modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>(); According to my research it does not allow deleting the cascade. I have a...
asked by 26.01.2015 / 15:59
1
answer

Entity Framework removing entities that have fk [closed]

I have in my repository, my method of deleting public virtual void Deletar(int Id) { var entity = _dbSet.Find(Id); _dbSet.Remove(entity); } The problem is that it is deleting even if it is with FK in another table, and I do not want it...
asked by 17.09.2014 / 15:46