Questions tagged as 'entity-framework'

2
answers

Entity Framework - tables were not created

I'm following an Entity Framework workbook, I created the classes: public class k19Context : DbContext { public k19Context() : base("k19Context") { } public DbSet<Turma> Turmas { get; set; }...
asked by 14.01.2017 / 12:14
2
answers

Html.EditorFor default value

How could I put Default value in a Html.EditorFor ? Understanding my code, I have a field that is a filter when I click on EditorFor opens the calendar, I would like the datetime.now to appear but only visual without do...
asked by 23.11.2015 / 15:35
1
answer

Exception DbUpdateException

I'm trying to study EF with Code First. I'm getting this exception at SaveChanges() An unhandled exception of type System.Data.Entity.Infrastructure. DbUpdateException occurred in EntityFramework.dll Additional information: An erro...
asked by 02.09.2015 / 03:26
1
answer

Make queries using the entity framework

Within my repository EF I have the methods, in method ExcluirRegistro I'm passing a StatusRegistro to the database which indicates that this record is being deleted, so in my methods ListarPorId and ListarTodos I'd li...
asked by 17.09.2015 / 20:33
3
answers

Validation to verify that the record is being used before deleting

My project's MVC is built into services, controllers, Views, and models. My delete screen works, but when the log is used in other tables it displays this error. The DELETE statement conflicted with the REFERENCE constraint "FK_XYZ". The co...
asked by 19.08.2015 / 21:55
2
answers

Field format for saving time

What field should I use in SQL Server to save a running time? Example: 2Days 23H 47Min 00Sec. If you have an example with Fluent API it will help a lot.     
asked by 23.06.2016 / 04:20
2
answers

Import and read from file

I have an Asp.Net MVC project with Entity Framework 4 and SQL Server, where there is a Action that receives via POST a csv file. Considering memory usage, processing time and resources, or any questions about the database...
asked by 31.05.2016 / 21:39
1
answer

Inheritance with Repository Pattern

I'm studying and trying to implement the Repository Pattern in C # but I'm having some difficulty solving certain inheritance problems between my Repository classes >, for example the inheritance between Pessoa , PessoaFisica...
asked by 03.12.2014 / 15:30
1
answer

C # - EntityFramework | Database Comparison

I started using EF recently, so I do not have much knowledge about it. I would like to know if I have a comparison of my class with the database, using EF. Comparison example: Employee Class has the following fields:    Code, Name, Z...
asked by 15.06.2015 / 19:13
1
answer

Return Join Linq C #

I'm trying to return a join for my class and it's giving me the following error    Error 1 Can not implicitly convert type   'System.Collections.Generic.List' in   'System.Collections.Generic.List' C: \ Projects \ ASP.NET \ AdvanceTechniques...
asked by 19.08.2014 / 15:36