I'm just trying to figure out if there is a simple way to store and retrieve binary (file) data using EF Code First CTP 5? I would really like it to use the FILESTREAM type, but I'm really just looking for some way to make it work.
I have an EF4 model with a stored procedure that I want to call from the client.
The server code looks like this:...[WebGet]
public IQueryable<SalesData> GetSalesReport(int reportType, int yr, int m, int d)
{
DateTime dt = new DateTime(yr, m, ...
The 'Category' table in database defined like this: ...CategoryID - PK ,identity specification ON (only this column has identity)
Description
Title
...I want to insert new data:...Category cat = new Category
{
Description = "xxx",
Title ...
What are the pros and cons of using linq queries(along with an ORM like EF or linq2sql) VS. Stored Procedures(SQL server 2008) to query and update a data model? Performance? Speed? Etc...
How can I get the sql script generated by an entity framework query?
i.e. If I write ...entityDataDontext.table1.Where(r => r.primarykey == 1).First();
...then how can I get the SQL which should be somewhat like this:...select * from table1 where primary...
I am trying to update a resource as follows:... public void Update(Resource resource) {
Resource _resource = _resourceRepository.First(r => r.Id == resource.Id);
_resource.Content = resource.Content;
_resource.Description = resource.Descriptio...
Lets consider default ASP.NET MVC application folder structure, so it's looks like this:...-App_data
-Content
-Controllers
HomeController.cs
-Models
AccountModels.cs
-Scripts
-Views
...My question is: Where is the best place to put Entity Framewor...
I need a very simple example of code to populate a DropDownList using Entity Framework 4....At the moment I use this code:... using (TestHierarchyEntities context = new TestHierarchyEntities())
{
uxSelectNodeDestinationDisplayer...
I have entities ...Group... and ...User.......
the ...Group... entity has ...Users... property which is a list of Users....
User has a property named ...IsEnabled.......I want to write a linq query that returns a list of ...Group...s, which only consists ...
After profiling my Entity Framework 4.0 based database layer I have found the major performance sinner to be a simple LINQ Any() I use to check if an entity is already existing in the database. The Any() check performs orders of magnitude slower than savi...
I'm trying to update a POCO object using entity framework in the following way:... context.Jobs.Attach(job);
context.SaveChanges();
...That does not work. No error is thrown, it just isn't updating the values in the database....I tried:...context.Jobs.At...
I am using the excellent Json.Net library to serialize my entities generated by entity framework. I use the following code to do so :...using (MyVoucherEntities context = new MyVoucherEntities())
{
List<MyObject> list = context.MyObjects.ToList();
str...
Possible Duplicate:...MetadataException: Unable to load the specified metadata resource...I hope someone can help with this. i have tried following other posts on here and dozens on other sites but i can get this working....the entity framework was all wo...
I have a asp.net MVC3 project using EF code-first. For my unit testing I have been using SQL Server CE 4.0 and SQL Server 2008 Express. Both have worked perfectly with EF generating my database as expected....However, when I run my application outside of ...
There is post ...here... that asks how to solve the circular reference error when returning a serialized object via EF4 CTP5. I ran into this same problem with a WCF web forms project a while back....I was able to "solve" this problem in my WCF/web forms...
I prefer using singular nouns when naming my database tables. In EF code first however, the generated tables always are plural. My DbSets are pluralized which I believe is where EF is generating the names but I don't want to singularize these names as I...
I'm new to the Entity model thing and i'm looking for an advise how to organize my Entity model....should i create one entity model file (.edmx) which will contain all the tables in my database or should i break it logical files for user, orders, products...
I have three classes, like so:...[DataContract]
public class ApplicationDto : BusinessBase<int>
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[DataMember]
public string Name { get; set; }
...
How do I pass a connection string to entity framework's code-first DbContext? My database generation works correctly when both DbContext and the connection string in web.config is in the same project and named the same way. But now I need to move the DbCo...
I am trying to reference a foreign key from SpouseId to Id in the Contact table. What is the syntax for doing this? I can't seem to find an example. Thanks....I have a class like this:...public class Contact
{
public int Id {get;set;}
public st...