First of all there is error message:
The entity or complex type 'AdventuresWorks.ProductSubcategory' cannot be constructed in a LINQ to Entities query.
Here is mu POCO class:
public class ProductSubcategory
{
public Int32 ProductSubcategoryID { get; set; }
public Int32 ProductCategoryId { get; set; }
p...
I'm very interested in using 4.0 framework and also the Entity Framework 4.0. Currently .net 4.0 is in CTP and I'm EF 4.0 is in CTP Preview. I will not be coding for a few more months, but i'm not so sure that either .net 4.0 or EF 4.0 will be RTM by then.
My questions:
1) Regarding Microsoft Products, is CTP usually stable enough ...
I will like to know that is there a way to exclude some fields from the database? For eg:
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
public string FatherName { get; set; }
public bool IsMale { get; set; }
public bool IsMarried { get; set; }
public string AddressAs { get...
I read that the new Entity Framework will include a method to delete multiple items (Linq to SQL has DeleteAllOnSubmit()) but I can't find the function/method to do that.
Is this in Beta 2 or do I have to make my own?
UPDATE:
This is what I'm using now:
public void DeleteObjects(IEnumerable<object> objects)
{
foreach ...
I am using VS2010 B2 and EF4 B2 and trying to use Rhino Mocks to mock the entity context generated by EEF.
var context = MockRepository.GenerateMock<SomeDBEntities>();
IObjectSet<TxMode> objectSet = new List<TxMode> { mode }.AsObjectSet();
context.Expect(c => c.TxModes).Return(objectSet);
The problem is that c.TxModes is a property of...
I have this problem for 2 months now
How can I use stored procedures whith RIA.
I was using LinqToSql and everithing works fine.
I've made an class in designer and mapped it to a SP.
Now in EF I saw this ComplexTypes I've imported son SP with result in ComplexTypes.
But in DomainDataSource are not appear.
OK.
But how can I use the...
After googling, I have only found only this sad forum question. Is it true I can't install EF4 on VS 2008 SP1? And if I can, how to do it - just install .NET 4 beta 2?
...
Our organization is looking to standardize on Entity Framework once v4 comes out. As a result, I am looking at what it would take to migrate our application that uses NHibernate for persistence to EF4 using POCO support. In a couple of places we use single table inheritance (also known as Table Per Hierarchy). I have been unable to get i...
I have a table w/ a sql date data type. When I look at the EDM markup, the storage element reflects this. The conceptual entity has a data type of DateTime (there doesn't appear to be a Date data type). When I call save changes and have a DateTime instance associated w/ the entity I want to persist, I get the following error:
The conver...
Is their a way using Entity Framework Code-Only to have an entity that has fields from two tables if both tables don't contain the primary key?
Here is an example.
public class BlogPost
{
public int PostID { get; set; }
public String PostBody { get; set; }
public int UserID { get; set; }
public string Username { get; se...
I know how to mark a group of fields as primary key in ADO.NET entities but i haven't found a way to declare unique constraints or check constraints.
Is this feature missing on the designer or on the framework?
Thanx.
...
I'm trying to buid a site with the following:
VS 2010 (for the updated WCF RIA Services)
Silverlight 4.0 (packaged with WCF RIA Services).
MVC 2
EF 4.0
I am setting it up so that the public facing pages will be html from MVC, but the administration portion will be a silverlight navigation application using using WCF RIA Services for ...
I'm using VS2010, EF4 feature CTP (latest release), and POCO objects, such as the example below:
class Person
{
public int ID { get; set; }
public string Name { get; set; }
public virtual IList<Account> Accounts { get; set; }
...
}
class Account
{
public string Number { get; set; }
public int ID { get; set; }
...
}
For the sak...
I am trying to setup a project using Entity Framework 4, POCO, and Code-Only.
Is it possible in entity framework for type of a navigation property to be an interface?
I have a "Task" class. A Task can be assigned to a user or a group each of which are represented by a separate class and stored in separate tables. The classes look som...
I have a Recommendation object and a FeedbackLevel object and the FeedbackLevel object is a navigation property inside a Recommendation object
Recommendation
int EntityKey;
FeedbackLevel Level;
Inserting a new one works just fine with AddObject(). Here's what I'm trying with the update, which doesn't work.
recommendation.Level = m...
If I have three classes in entity framework.
class Base {}
class Left : Base {}
class Right : Base {}
and I call DBContext.Bases.ToList();
This returns all instances of Base fully typed into their associated inherited types, as some people have noticed, the performance of EF on large inheritance structures is not great to say the l...
Aside from faster development time (Visual Studio 2010 beta 2 has no T4 templates for building POCO entity objects that I'm aware of), are there any advantages to using the traditional EntityObject entities that Entity Framework creates, by default? If Microsoft delivers a T4 template for building POCO objects, I'm trying to figure out w...
Question 1: I am playing around with EF4 and I have a model class like :
public class Candidate {
public int Id {get;set;}
public string FullName {get;set;}
public Gender Sex {get;set;}
public EducationLevel HighestDegreeType {get;set;}
}
Here Gender and EducationLevel are Enums like:
public enum Gender {Male,Female,Undisclosed}
pub...
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...
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...