I'm new to EF and I have two tables, the first called ContestEntry and the second Items which has a one to many relationship with ContestEntry. I'm trying to access Contest Entries and then from there get the related Item information. Here is the code I'm using.
ContestEntry cEntry =
Ctx.ContestEntries.Include("Item").Where(ce ...
Hi guys
I have started using linq to sql and the entity framework and have found the development experience to be fairly good. Like the way you can break a query apart and combine different queries is quite nice - see pipes and filters.
But the problem that I have found is that performance can be greatly increased (in my case by a fa...
I've two tables named Modules and Privileges which are related by a foreign key relationship as shown below:
I'd like to model Module and Privilege by adding ModuleName to Privilege. Later I'd be interested in creating a derived class (Menu in the illustration) from Privilege by adding a discriminating condition on ModuleName. Is this...
I am getting this error message when ever I try to update or save my Entity Data Model:
ERROR: Unable to register the build provider in Web.Config because of the following exception: 'Object reference not set to an instance of an object.'.
Then when I try to run the application I get:
The specified named connection is either not foun...
We've adopted the Entity Framework and we're finding that when multiple people make isolated changes in their individual source control branches, there are massive conflicts when they come together in a merge, resulting in broken model files.
We're leaning in the direction of forcing exclusive check outs on the file, but I'd like to avo...
Using EF how do i access values in a parent property when accessing a list of child objects.
i.e. I have a Project object and Timesheet object
Project
Id
Name
...
TimeSheet
ProjectId
UserId
Date
TimeSpent
...
I understand how to get back a Project and its related Timesheets but what if I want to get back all of the timesheets for a ...
Our current enterprise solution is a ASP.NET MVC application driven by the Entity Framework. There are a couple links on how to hook into the change events for auditing. I'm not really interested in this.
I'm interested in enterprise level auditing architecture. Those of you with the enterprise level battle wounds, what has been yo...
I have a plain old CLR object which is essentially a wrapper for two entity framework objects, I'm doing this so I can pass this wrapper object to a strongly typed view in the MVC framework. My foo wrapper class is very simple:
public class FooWrapper
{
public FooWrapper(Foo f, Bar b)
{
this.FooObject = f;
this.B...
Recently I've began experimenting with ASP.NET MVC and the Entity Framework. Since my hostingprovider only provides me with MySQL I've been trying to set that up.
Locally everything works fine, but after I publish it I get the following error:
[ProviderIncompatibleException: The store provider factory type 'MySql.Data.MySqlClient.MySqlC...
The following query fails to load the tables when I execute it:
IEnumerable<Bookmark> tempBookmarks = ListBookmarksByUserID(userID);
IEnumerable<CandidateWithBookmarks> results = (from c in _internshipEntities.CandidateSet
.Include("education")
.Incl...
I'm loosely following an excellent series of blog posts by Kazi Manzur Rashid as a learning exercise for learning how to implement some new (for me at least) design patterns, but I'm getting trouble from the start.
I've basically copied his code for the Database, RepositoryBase and RepositoryBaseTests classes, but when I try to run the ...
Hi,
I'm implementing the repository pattern found here Implementing Repository Pattern With Entity Framework
One of the methods he has is SelectByKey. In the comment called Key field impementation by [email protected], there was a suggestion to make it a little more generic of an implementation:
I would like to add a simple mechani...
Following the KISS principle, I suddenly realised the following:
In .NET, you can use the Entity Model Framework to wrap around a database.
This model can be exposed as a web service through WCF.
This web service would have a very standardized definition.
A client application could be created which could consume any such RESTful web se...
Hi,
I have two Entities "Article" and "Picture", and there is a "Comment" Entity to hold the comments for any Article and Picture. (I know i can have two tables for comments, ArticleComment and PictureComment)
The Comment table structure is;
Id numeric(18,0) System.Long
CommentType byte CommentType (CommentTy...
I have a repository Class which takes in a ObjectContext called "TestDB". I when I launch my web application i'm getting a "Unable to load the specified metadate resource", almost like its not picking up the connection settings from my web.config file anymore.
Here is a snippet of my code.
[Inject]
public SqlCatelogRepository(){
_da...
I have a LINQ-2-Entity query builder, nesting different kinds of Where clauses depending on a fairly complex search form. Works great so far.
Now I need to use a SQL Server fulltext search index in some of my queries. Is there any chance to add the search term directly to the LINQ query, and have the score available as a selectable prop...
I am just starting to learn a bit about the entity framework and don't have much experience with ORM's.
In my little app I have one table, this sql server table has several columns including a PrimaryKey (int) a Name (string) and a Flag (tinyint).
When I imported this table into it automatically assigned the Flags' datatype as a byte. ...
I have a Departments table, which has a foreign key column to Sites, on Department.SiteId = Sites.SiteId. Now in my EF model, my Departments entity doesn't have a Siteid attribute, just a reference to Sites. How do I select, in a LINQ query, all departments with a specific SiteId?
...
I need to select from varying levels of reporting department tables, i.e. Dept1, Dept2, Dept3, ect. [1] depending on which reporting level the user chooses. How can I dynamically express the 'table' to select from based on a given string parameter, which is the table name?
[1] Easy points (lets talk) for anyone that can help me out of ...
What if I want to connect to Oracle, MySQL or even MS Access ?
...