Questions tagged as 'entity-framework-6'

1
answer

List most frequent items in the database using LINQ

I would like to list on the screen, type a ranking, the most frequent items in the database table through its name, for example: John appears 6 times; Joseph appears 4 times; Maria appears once. Would anyone help me?
asked by 26.02.2016 / 20:12
1
answer

SqlServer 2012 - Column '' in table '' is of a type that is invalid for use as a key column in an index

After seeing this error when creating a NONCLUSTERED index I wondered if it would really be necessary to create this index in the following scenario: I have a table with 11 columns, a column I store a URL, ie it is a column nvarchar(300)...
asked by 14.05.2015 / 22:59
2
answers

List group only containing items

And an example of model : public class Grupo { public int Id {get;set;} public string Nome {get;set;} public ICollection<Item> Itens {get;set:} } And the items public class Item { publit int Id {get;set;} public...
asked by 25.02.2015 / 02:44
1
answer

Enable delete cascade in only one list

I have my model that has multiple lists. For example: public class Funcionario { public ICollection<FuncionarioNotificacao> Notificacoes {get;set;} public ICollection<FuncionarioExame> Exames {get;set;} } Let's see that...
asked by 27.03.2015 / 15:12
1
answer

Authentication, email / password and knowing the correct bank

The idea is a SaaS application. Where there will be only 1 deploy. and clients will be separated by bank Once this is done, there will be a login screen, where you will be informed of the login (email) / password But how do I route it t...
asked by 14.08.2014 / 02:15
1
answer

Error in query linq

I'm trying to query the table below from my database. Thisqueryisperformedusingthemethodbelow:public void compraAcoes(float cepf, string codigo, int quantidade) { string cd = codigo; try { float cpf; BuscaNet bus...
asked by 01.06.2014 / 22:02
1
answer

HasColumnName does not recognize field

I'm working with the Entity Framework 6.1, using the code first approach. I mapped my class to the database through class EntityTypeConfiguration . When I map a property with a table field, using the code below, for example: namespa...
asked by 07.05.2014 / 15:04
1
answer

Failed to populate a gridView

I'm having problems displaying a gridview, it's not displaying the right data, it looks like it's trying to display vertically, I've already changed the Gridline property to horizontal, both and now this Name, same as another gridView I've been...
asked by 15.06.2014 / 03:41
1
answer

Fluent Mapping or Data Annotations?

I was watching a video lesson on ASP.NET MVC, when I see the Fluent Mapping of the Entity Framework for the first time. Soon I came to doubt. Which of the two is best recommended? Fluent Mapping or Data Annotations ? I really liked...
asked by 30.09.2014 / 03:50
1
answer

Entity Framework - Error?

I'm following a Entity framework tutorial: Simple Code First Example it is quite simple, but for some reason it is not working here and it appears the error message is as follows:    AspNet \ Projects \ ENTITY \ ENTITY \ App_Data \ E...
asked by 09.06.2017 / 23:51