tagged [entity-framework]
Can you create sql views / stored procedure using Entity Framework 4.1 Code first approach
Can you create sql views / stored procedure using Entity Framework 4.1 Code first approach Entity Framework 4.1 Code First works great creating tables and relationships. Is it possible to create sql v...
- Modified
- 27 Sep at 15:8
In what scenarios do I need foreign keys AND navigation properties in entity framework
In what scenarios do I need foreign keys AND navigation properties in entity framework My Order class has: Do I really need both properties to make a relation working? I am not using disconnected enti...
- Modified
- 5 Feb at 20:52
Setting schema name for DbContext
Setting schema name for DbContext I know how to set the schema for a table in my context but is there a way to set the default schema for all the tables in a context? i.e.
- Modified
- 28 May at 16:40
Dynamic Include statements for eager loading in a query - EF 4.3.1
Dynamic Include statements for eager loading in a query - EF 4.3.1 I have this method: ``` public CampaignCreative GetCampaignCreativeById(int id) { using (var db = GetContext()) { ...
- Modified
- 3 Apr at 20:41
Force Entity Framework 5 to use datetime2 data type
Force Entity Framework 5 to use datetime2 data type Is it possible to globally set Entity Framework `DbContext` to use `datetime2` for all properties that are `System.DateTime` when using Code-First m...
- Modified
- 6 Mar at 13:22
What is the difference between JSON.NET DataContractJsonSerializer and the Newtonsoft JSON serializer
What is the difference between JSON.NET DataContractJsonSerializer and the Newtonsoft JSON serializer Can someone help me. What's the difference between the built in JSON.NET DataContractJsonSerialize...
- Modified
- 27 Jun at 05:44
get date part only from datetime value using entity framework
get date part only from datetime value using entity framework I want to get date part only from database 'date time' value I m using the below code..but it is getting date and time part.
- Modified
- 2 Jun at 05:34
Entity Framework - printing EntityValidationErrors to log
Entity Framework - printing EntityValidationErrors to log I get the follo0wing error when I print my log The EntityValidationErrors object holds the full detailed error in different nodes. What
- Modified
- 11 Dec at 17:36
Cannot enable migrations for Entity Framework in class library
Cannot enable migrations for Entity Framework in class library I just got on board with EF 5 and am using their code-first migrations tool but I seem to get an error when I try to enable migrations. I...
- Modified
- 23 Feb at 03:55
What is model column in MigrationHistory table?
What is model column in MigrationHistory table? In EF6 when you use Code First Migration, it creates a table that called `__MigrationHistory` with four column: What is the binary data in `Model` field...
- Modified
- 23 May at 17:8
Upgrade from Entity Framework 5 to 6
Upgrade from Entity Framework 5 to 6 After upgrading our project from using Entity Framework 5 to Entity Framework 6 (though NuGets update function) i get the following error on my generated Entities ...
- Modified
- 12 Mar at 00:0
Entity Framework - getting a table's column names as a string array
Entity Framework - getting a table's column names as a string array If I'm using EF 5 and Database first to generate a .edmx model of my database, how do I get a list of an entity's columns? What I'm ...
- Modified
- 31 Oct at 10:45
Run Custom Tool for Entity Framework, what does it do?
Run Custom Tool for Entity Framework, what does it do? In Visual Studio, when working with Entity Framework and applying Run Custom Tool for .tt and .Context.tt files, What is it and what does it do? ...
- Modified
- 29 Dec at 08:53
Setting unique Constraint with fluent API?
Setting unique Constraint with fluent API? I'm trying to build an EF Entity with Code First, and an `EntityTypeConfiguration` using fluent API. creating primary keys is easy but not so with a Unique C...
- Modified
- 15 Nov at 21:18
What is the difference between ExecuteSqlCommand vs SqlQuery ? when doing a db access?
What is the difference between ExecuteSqlCommand vs SqlQuery ? when doing a db access? I have had a couple of suggestions on how to access data from my database: Can someone explain the difference bet...
- Modified
- 16 Jun at 16:36
How do I use the SqlResource method in EF Migrations?
How do I use the SqlResource method in EF Migrations? MSDN says this method "Adds an operation to execute a SQL resource file". Its signature is: And the `sqlResource` parameter is described as `The m...
- Modified
- 24 Nov at 05:11
Using a enum with flag in an Entity Framework query
Using a enum with flag in an Entity Framework query i have a enum type like below ``` [Flags] public enum WeekDays { Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8, Frida...
- Modified
- 25 Apr at 19:24
Add new Required Field to one of table with EF Code First Migration
Add new Required Field to one of table with EF Code First Migration I am using EF Code First Migration. I already have lots of data on production Db and I would like to intorduce a non nullable field....
- Modified
- 3 Dec at 14:23
Seed initial data in Entity Framework 7 RC 1 and ASP.NET MVC 6
Seed initial data in Entity Framework 7 RC 1 and ASP.NET MVC 6 It seems that in Entity Framework 7 there is no native support for seed data yet ([https://github.com/aspnet/EntityFramework/issues/629](...
- Modified
- 30 Dec at 19:34
Better way to query a page of data and get total count in entity framework 4.1?
Better way to query a page of data and get total count in entity framework 4.1? Currently when I need to run a query that will be used w/ paging I do it something like this: ``` //Setup query (Typical...
- Modified
- 12 Aug at 12:23
Code-first migration: How to set default value for new property?
Code-first migration: How to set default value for new property? I am using EF6 for storing instances of the `report` class in my database. The database already contains data. Say I wanted to add a pr...
- Modified
- 30 Jun at 00:26
Entity Framework Code First Date field creation
Entity Framework Code First Date field creation I am using Entity Framework Code First method to create my database table. The following code creates a `DATETIME` column in the database, but I want to...
- Modified
- 25 May at 12:45
Why is entity still validated when it is gone?
Why is entity still validated when it is gone? 1. Add a new entity to a TrackableCollection (context.Entities.Add(entity)) (EntityState = New) 2. Without saving, delete the added entity from Trackable...
- Modified
- 7 Jun at 23:27
Set Command Timeout in entity framework 4.3
Set Command Timeout in entity framework 4.3 I cannot find the a way to set the command timeout of a linq query using entity framework 4.3 and its' DbContext. How do I increase Commandtimeout in entity...
- Modified
- 31 Jul at 20:17
DbSet.Attach(entity) vs DbContext.Entry(entity).State = EntityState.Modified
DbSet.Attach(entity) vs DbContext.Entry(entity).State = EntityState.Modified When I am in a detached scenario and get a dto from the client which I map into an entity to save it I do this: What is the...
- Modified
- 22 Jul at 04:10