While the application I am developing at the moment is written in .net 4.0 against the beta, I have largely been ignoring POCO support in the Entity Framework because I didn't need it. I'm starting to realize, however, that POCO support would be useful in my project. However, Google searches on POCO in the EF yield a lot of results about...
I'm trying to find some best-practice examples (or any examples, actually) of using Machine.Specifications with the ASP.Net Entity Framework in an MVC project.
Not having had much experience with Machine.Specifications, I'm keen to see what sort of tests other people find useful and whether there are any gotchas for using the EF-generat...
I'm using a DataGridView to display EntityObjects from the .NET Entity Framework.
how could I change the formatting of a row of the DataGridView if the corresponding EntityObject has been altered by the user, e.g. displaying the row in bold
greetings
...
I'm trying to convert this code from a stored procedure into a "LINQ to Entities" query:
select * from myTable
where venue_date + start_time <= @EndDate
and dateadd(minute, duration * 24 * 60, venue_date + start_time) >= @StartDate
As you can see there is some manipulation of dates. This sort of thing won't work because functions such...
I am tasked to build a web 2.0 style mashup application which consumes a lot of 3rd party webservices like youtube and twitter. There are also lots custom features which are going to be built using ASP.NET 3.5 and SQL Server 2008. Now I am looking for the right ORM for my needs. From a performance and ease of use standpoint can anyone su...
I'm building multi-project Application where some UserControl, the user control has a Entitymodel object (myDBContainer db = new myDBContainer()), when i drop my user control on my a form i got the following designer error
The specified connectionis either not
found in the configuration, not
intended to be used with the
entityc...
I'm writing NUnit tests for a service.
I've decided to do this by sending direct SQL statements to the database instead of using the Entity Framework model so that I could be certain of the results, i.e. I am testing what is in the database and not what the Entity Framework tells me is in the database (e.g. it could be reporting a cache...
How do you handle the case when an entity needs to create, in one of its methods, other entities? My problem is that since each individual entity doesn't have access ObjectContext object, that one with the AddToBlahs() methods, it cannot do it.
For example, having a Site model that has a UpdateLinks() method that is supposed to create L...
Using EF 4, I have several subtypes of a 'Business' entity (customers, suppliers, haulage companies etc). They DO need to be subtypes. I am building a general viewmodel which calls into a service from which a generic repository is accessed.
As I have 4 subtypes, it would be good to have a 'generic' viewmodel used for all of these. Probl...
I'd like to say it's the query, but it isn't. Even when we go through it step-by-step, the queries finish without a hitch. Even the .DataBind() method doesn't APPEAR to cause the lag.
Here's how I know it has to do with my IQueryable as the binding source:
Old code:
Call a stored procedure using SqlCommand and use SqlAdapter to fil...
I've been looking for an example about how to build an one-to-one relationship in EF4v2 with POCO's. I found a lot of examples that show only how to create one-to-many or many-to-many. Do you have any resource about it?
...
I have recently been getting this error on my ASP.NET MVC project that uses the Entity Framework:
At least one SSDL artifact is required for creating StoreItemCollection
The error occurs when I try to query the database in a controller action. Has anyone seen this error before? It only occurs every once in a while for me but I am...
How to load in a following EF entities:
image source: http://blogs.microsoft.co.il/blogs/idof/archive/2008/08/20/entity-framework-and-lazy-loading.aspx
Let's say we have address id and we want to load address with person and the pets. How to do that?
We can do that
var address = contex.Addresses.Include("Peson").Where(add => add.Id...
Hi!
I have created a partial class of an entity for getting a foreign key property on it.
public partial class Artikel
{
public int WarengruppenID
{
get
{
if (WarengruppeReference.EntityKey == null) return 0;
return (int)WarengruppeReference.EntityKey.EntityKeyValues[0].Value;
}
...
While trying a sem-complex query to display some ListView content on the page I got stuck on the famous "Only parameterless contstructor and initializers are supported in LINQ to Entities" error.
Here is the code I used ... I can't find a place where I initialized something inside the query with parameters ....
protected void ArtistsL...
I'm using .net framework 3.5 SP1.
After adding a column to one table in Sql Server (as well as changing an existing column from allowing nulls to not nullable), I can no longer run my project without getting this error:
The number of members in the
conceptual type
'XBRLDimensionalModel.axis_t' does not
match with the number of...
Hi all,
First and foremost. Sorry about my English, i'm still learning :)
I'm currently wrestling with the MVVM model.
At the bottom, i have a database.
On top of that sits my DAL which is bascily the ADO.NET entity framework. *Note that the different entities are also my business objects (since i include validation in them).
On to...
How can I bind a wpf control to a SQL Server property. Like say a Listbox
<ListView>
<ListView.View>
<GridView>
<GridViewColumn Header="Name">
<GridViewColumn Header="Date Assigned">
<GridViewColumn Header="Date Due">
</GridView>
</ListView.View>
...
Having two models, Site and Link, where a site has many links, how do I delete a link from inside a method of Site, which doesn't have access to the object context?
I've tried something like:
public void DeleteFirstLink() {
var link = LinkSet.First();
LinkSet.Remove(link);
}
but it seems that is not really deleting the link, ...
All of our database tables have UpdateUserID and UpdateTS. I'd like to have this set if my entity has changes. Is there a way I can have this update on the spot conditionally? If I manually set UpdateTS in code, then it will say that my entity has changed and will always update the object.
...