Let's say I have a SQL 2005 database with a table called Restaurants. The Restaurants table has the following columns:
RestaurantId
Name
Latitude
Longitude
I want to let users search for restaurants by name and/or address. How do I write the LINQ query to support this? I need to be able to support the possibility that the user doesn'...
I want so store a histogram of an image in a database. In the program the histogram is represented as an array of doubles (exactly 64)
What's is the best way to add it to entity model? (anything better than adding complex type with multiple double values?)
P.S. If it matters - I plan to generate my db from the entity model.
...
I'm getting to grips with EF4 code first, and liking it so far. But I'm having trouble mapping an entity to a table with a composite primary key.
The configuration I've tried looks like this:
public SubscriptionUserConfiguration()
{
Property(u => u.SubscriptionID).IsIdentity();
Property(u => u.UserN...
So I've started to add Entity Framework 4 into a legacy web application (ASP.NET WebForms).
As a start I have auto-generated some entities from the database. Also I want to apply Repository Pattern.
There is an entity called Visitor and its repository VisitorRepository
In VisitorRepository I have the following method:
public IEnumera...
We are planning to move to Silverlight 3 for application development because we want to take advantage of more flexible UIs and easier deployment. We have previously used Winforms with ADO.Net and SQL Server for data driven applications.
I've briefly looked at some of the options for data access with silverlight such as Entity Framework...
Hi.
Did you ever used EF4 and Velocity(or other caching framework) together?
I found this blog post Tracing and Caching EF.
...
Hi,
in Entity Framework in VS2010 (in a C# project) how do I configure a new association in the Mapping Details pane? I don't quite get the Mapping Panel, in particular when you click on one of the Navigation Properties in a table.
Once I've added the association between two tables, I can see it visually as a line between the tables, ...
At work we are inte process of starting development on a new web-based product. Before doing so we need to establish what technology stack we are going to use. For this application my preference would have been to use Django but since the development- and management-team is soo heavily rooted with Microsoft the new product will have to b...
Hi.
I have to write a solution that uses different databases with different structure from the same code. So, when a user logs to the application I determine to which database he/she is connected to at runtime. The user can create tables and columns at any time and they have to see the change on the fly. The reason that I use one and th...
My Entity Model is as follows:
Person , Store and PersonStores Many-to-many child table to store PeronId,StoreId
When I get a person as in the code below, and try to delete all the StoreLocations, it deletes them from PersonStores as mentioned but also deletes it from the Store Table which is undesirable.
Also if I have another person w...
Does anyone have a technique to automap (using Automapper) references to child entities. So say I have a ViewModel:
class AddressModel
{
int Id;
string Street;
StateModel State;
}
class StateModel
{
int Id;
string Name;
}
And I pass this into a repository to map to equivalent entities in Entity Framework. When Aut...
Summary: We're having problems with EF4 query compilation times of 12+ seconds. Cached queries will only get us so far; are there any ways we can actually reduce the compilation time? Is there anything we might be doing wrong we can look for? Thanks!
We have an EF4 model which is exposed over the WCF services. For each of our entity typ...
I apologize if this seems like an excessively dumb question.
I am trying to use the ContextBuilderClass to generate my Context. I am unable to find the proper assembly and namespace to use it though.
Just for reference I am on a full install of VS 2010 Pro.
...
I have a column like this in 1 of my database tables
DateCreated, datetime, default(GetDate()), not null
I am trying to use the Entity Framework to do an insert on this table like this...
PlaygroundEntities context = new PlaygroundEntities();
Person p = new Person
{
Status = PersonStatus.Alive,
...
Hi,
Can Entity Framework create incremental SQL scripts for updates? (or would you need to do this in a separate database tool)
(i.e. for my application updates I need to package the DB upgrade script that gets applied after download - windows forms type app)
...
Hi,
In Entity Framework (VS2010) how do I create an association to/from the same table? (a many-to-many is what I want)
Background - I was expecting under the bonnet a NODE and RELATIONSHIP table, where the latter has a parent_node_id and a child_node_id (i.e. pointing back to the NODE id column). I can't seem to get the designer to ...
Hi,
VS2010/EntityFramework - Is it possible to execute generated sql for a Sqlite database? (like you can for SQL Server).
When I try to do this I only seem to get SQL Server type options re which database to execute the SQL against (even though my Entity Framework design was based on the initial/successful upload from a SQLite databas...
Hi,
I'm getting very confused about how to call my EF classes in a Class Library from the Client Project I have? Things worked fine when they were in the same project. Now I'm getting errors such as "Unable to load the specified metadata resource ".
I've see various ideas / suggestions re how to fix the connection string (e.g. creat...
We're about to begin development on a mid-size ASP.Net MVC 2 web site. For a typical page, we grab data and throw it up on the web page, i.e. there is not much pre-processing of the data before it is sent to the UI.
We're now making the decision whether or not to use an ORM and if yes, which one. We had been looking at EF2 AKA EF4 (...
Hi,
On a webserver (shared hosting provider) I published a website with a ADO.Net Framework model in use with MySql Connector 6.3.1. When I request a page, a Security Exception will be happen with this error messages:
"LinkDemand The type of the first permission that failed was: System.Security.Permissions.SecurityPermission The Zone o...