Questions tagged as 'entity-framework-6'

2
answers

Error localhost Visual Studio

My VS was working perfectly, today I bought and installed the kaspersky antivirus, when I was running an ASP.NET site (MVC) the following error appeared:    UNABLE TO START PROGRAM '' An operation is not   valid in the current state.  ...
asked by 23.02.2017 / 22:38
3
answers

Validate field after typing in ASP.NET MVC

I have a registration page in ASP.NET MVC with Entity Framework, this register has an indication field, where you must be informed the nickname of the user that indicated. I wanted to type this field after the user validate in the ASP.NET con...
asked by 07.03.2017 / 05:06
1
answer

Why are relations in the Entity Framework code first pointed to with ICollectionT?

Why relationships in the Entity Framework code first are pointed to with ICollection? What is the best instantiation (?) For the property in common cases? List Is the use of the virtual keyword only to enable lazy loading on the property?     
asked by 06.01.2015 / 21:51
2
answers

How does the Tracking / Chache of EntityFramework objects work?

Whenever I used EntityFramework in a project, to add a record in the database through it, of a class that contains class type memberships (usually on behalf of ForeignKeys ), I did the following: After the entity instance, it filled in t...
asked by 09.05.2015 / 04:05
1
answer

Map one-to-many entity with Fluent API

I have two classes, as an example below: public class Foo { public virtual int Chave {get; set;} public virtual List<Bar> Bar {get; set;} } public class Bar { public virtual int Chave {get; set;} public virtual Foo Foo...
asked by 12.10.2014 / 02:20
3
answers

Scaffolding error during View generation

I'm creating a new project using EF Power Tools and I get the following error:    Error   There was an error running the selected code generator:   'A configuration for type' TST2.Models.Course 'has already been added.   To reference the ex...
asked by 24.11.2015 / 12:53
1
answer

Is the query generated by the Entity Framework valid for use in ADO?

I want to have a higher performance in a query that I perform in the system Consequently using ADO is much faster than Entity Framework What% of the% it generates when querying could be used to create a query or use wi...
asked by 05.11.2015 / 17:19
2
answers

Adding text box and saving to the bank. (with C #, entityframework 6.1.3)

I'm doing a project in Visual Studio 2013, with EntityFramework version 6.1.3, MVC 4.5.0.0 and using ViewModel . I'm programming a page called payment condition. The creation page will have a text field nome , 2 radiobuttons : "t...
asked by 21.09.2015 / 16:04
2
answers

Error deleting using Entity Framework 6 and custom repository

I am using the Entity framework to do CRUD in the database, but I have an error trying to delete some item:    "The object can not be deleted because it was not found in the   ObjectStateManager. " I'm using the repository pattern, unit o...
asked by 24.06.2015 / 15:27
1
answer

Error in 1 to 1 relationship declaration in EF with code-first and attributes!

I have the following classes where I want to do a 1 to 1 relationship: User: [Table("Usuario")] public class Usuario { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Required]...
asked by 01.07.2014 / 16:38