entity-framework-4 Questions
17
Solved
I'm using Entity Framework 4 with the Model First approach.
I started the project, designed the entities and generated the database. Everything worked fine.
Then I needed to go back and add anoth...
Mispickel asked 14/4, 2011 at 17:47
3
Solved
Is there any way to see if property of an entity is navigation property, from its metadata?
I can determine if property is entity collection by inspecting if it implements ICollection and from the...
Bummer asked 20/4, 2012 at 18:50
2
Solved
This has caused me no end of problems today. I have this simple query
var result =
DataContext.Accommodations.Where(a =>
(criteria.MinPrice == null || a.AccommodationRates.Any(r => r.From...
Germanous asked 5/9, 2012 at 15:10
7
Solved
I am using EF 4 Database first + POCOs. Because EF has no easy way to state that incoming DateTimes are of kind UTC, I moved the property from the auto-generated file to a partial class in another ...
Bombacaceous asked 3/8, 2011 at 18:1
7
Solved
var result =
(from bd in context.tblBasicDetails
from pd in context.tblPersonalDetails.Where(x => x.UserId == bd.UserId).DefaultIfEmpty()
from opd in context.tblOtherPersonalDetails.Where(x =...
Terrell asked 20/7, 2012 at 18:4
17
Solved
Here's the table
Users
UserId
UserName
Password
EmailAddress
and the code..
public void ChangePassword(int userId, string password){
//code to update the password..
}
Mausoleum asked 4/9, 2010 at 12:56
11
I have a problem with an EDMX file which I've never encountered before. Seemingly randomly when the site is running or I'm debugging, the EF will bomb out and complain that everything is re-defined...
Tamboura asked 24/7, 2011 at 15:24
2
Solved
I'm using Entity Framework CTP5 and Code First. I need to change the Collation for a specific column in SQL Server. I believe the default collation is SQL_Latin1_General_CP1_CI_AS, but I need to ch...
Teacup asked 12/3, 2011 at 21:57
2
Solved
I am having some problem setting the Identity Seed on the Id column in SQL Compact 4 using the code first approach.
I have tried this
context.Database.ExecuteSqlCommand("DBCC CHECKIDENT ('Members...
Petaliferous asked 31/7, 2012 at 1:56
6
Solved
I have the following EF query:
TestEntities db = new TestEntities();
var questions = from q in db.Questions.Include("QuestionType")
from sq in db.SurveyQuestions
where sq.Survey == surveyTypeID
...
Thermodynamics asked 17/12, 2010 at 21:37
15
Solved
I get this error when writing to the database:
A dependent property in a ReferentialConstraint is mapped to a
store-generated column. Column: 'PaymentId'.
public bool PayForItem(int terminalI...
Weather asked 17/6, 2011 at 10:50
5
Solved
i have a enum type like below
[Flags]
public enum WeekDays
{
Monday = 1,
Tuesday = 2,
Wednesday = 4,
Thursday = 8,
Friday = 16,
Saturday = 32,
Sunday = 64,
}
WeekDays dw = WeekDays....
Carollcarolle asked 25/4, 2012 at 19:24
9
I've deleted the connection string from my web.config and Entity Framework is still connecting to the database! Where is the connection string being set? This is an issue because I need to make the...
Dingy asked 26/4, 2011 at 12:30
2
Solved
I have a MVC 3 site but am using the non-MVC FluentValidation dll. I've created a validator class and in the constructor put all my RuleFors and then set an attribute on my model class thus
[Fluen...
Selfdevotion asked 11/6, 2012 at 16:42
16
Solved
I have query in a stored procedure that calls some linked servers with some dynamic SQL. I understand that EF doesn't like that, so I specifically listed all the columns that would be returned. Yet...
Larcher asked 20/8, 2011 at 0:35
4
Solved
I am using the entity framework (ef) and am getting the following error:
"The result of a query cannot be enumerated more than once.".
I have a repository class which contains the ef data con...
Canna asked 19/4, 2011 at 22:35
11
Solved
Simplest example of this, I get a collection and try to output it via Web API:
// GET api/items
public IEnumerable<Item> Get()
{
return MyContext.Items.ToList();
}
And I get the error:
...
Azores asked 19/12, 2012 at 18:48
3
Solved
Preamble:
My core question is very similar to this one: How can I write a clean Repository without exposing IQueryable to the rest of my application? which has remained unanswered. I am hoping that...
Clutter asked 30/12, 2011 at 19:46
12
I have a one entity framework object and when I add it to my project, the connectionstring
is added to app.config in the connectionstring section, but when I want to create new entitycontext and us...
Karnak asked 16/8, 2010 at 6:58
6
Solved
Suppose I have a table with the column Description, varchar(100). If try to insert a string with more than 100 characters, the insert will fail.
Is there a way in Entity Framework to automatically...
Links asked 22/2, 2011 at 16:43
8
Solved
How do I tell EF what to name the database and where to put it?
If there is no connection string in the Web.Config, it tries to put it in the local SQLEXPRESS Server, but I want to put it out on a...
Muscatel asked 18/3, 2011 at 0:52
7
Solved
I'm trying out LINQ to entities.
I have a problem with the following:
I want it to do this:
SELECT
T_Benutzer.BE_User
,T_Benutzer_Benutzergruppen.BEBG_BE
FROM T_Benutzer
LEFT JOIN T_Benutzer_...
Malkamalkah asked 14/10, 2013 at 8:43
8
Solved
I added EntityFramework.Migrations (Beta 1) to an existing Code-First app that is going through some changes (for both migration capabilities and more fine-tuning of the tables I am generating from...
Inquiring asked 21/12, 2011 at 18:16
5
Solved
I have created migration and created the database and the tables . For example the tables are
A B C D E . Now again I have changed some part of code and ran update-database command . Everything w...
Belita asked 1/2, 2014 at 7:50
2
Solved
Are entities required to be mapped to a table or can they map to a stored procedure?
I have an entity that does not map to any specific table, instead it maps to a stored procedure.
I am getting...
Wagshul asked 13/10, 2010 at 7:28
© 2022 - 2024 — McMap. All rights reserved.