entity

LINQ to Entities projection of nested list

Assuming these objects... class MyClass { int ID {get;set;} string Name {get;set;} List<MyOtherClass> Things {get;set;} } class MyOtherClass { int ID {get;set;} string Value {get;set;} } How do I perform a LINQ to Entities Query, using a projection like below, that will give me a List? This works fine with a...

Entity Framework How to specify paramter type in generated SQL (SQLServer 2005) Nvarchar vs Varchar

In entity framework I have an Entity 'Client' that was generated from a database. There is a property called 'Account' it is defined in the storage model as: <Property Name="Account" Type="char" Nullable="false" MaxLength="6" /> And in the Conceptual Model as: <Property Name="Account" Type="String" Nullable="false" /> When sel...

Entity Framework 1:1 Relationship

I have 3 tables which are having 1:1 relationship and i want to insert a Record problem is that out of these 3 tables 1 table is inturn having 1:1 relationship with Another Table so now when i try to insert record in 3 Table, EF is asking me to get the 4th table as well and adding a empty Record in 4th table which i dont want can anybody...

Where to start .NET Entity Framework and ORM?

Hello I haven't used any database system enough but i believe i know logic of databases and i have learnt little sql so i shouldn't start to learn ORM before learn them well? Where can i start to learn .NET Entity Framework and which version of framework i have to start 3.5 or 4.0 because i heard that 4.0 has strong support for Enti...

Unicode symbols coming wrong

Obviously, there must be something stupid i'm doing. The unicode chart for subscripts and superscripts says #00B2 is superscript 2, but i get scrambled output. 0078 is x, but I get N, and 0120 is x. Am i reading wrong manual? EDIT $x = '&#0078;'; print html_entity_decode($x, ENT_NOQUOTES, 'UTF-8') . "\n"; ...

Entity Framework 4.0 Mapping POCOS with different property names from db fields names

Hi, I'm a newbie to ADO.Net Entity framework 4. I have a set of pocos which I need to map to a legacy database. The problem is that the db field names are different to the poco property names. eg. db field name = 'cusID' and poco property = 'CustomerID'. What is the best way to map these? ...

App Engine: how would you... snapshotting entities

Let's say you have two kinds, Message and Contact, related by a db.ListProperty of keys on Message. A user creates a message, adds some contacts as recipients, and emails the message. Later, the user deletes one of the contact entities that was a recipient of the message. Our application should delete the appropriate Contact enti...

POCO inherited type could not pass addObject method

Hi all I am using a POCO class name "Company" generate from the T4 POCO code generator to create a derived class - name "CompanyBO" by "public class CompanyBO:Company", but when i call addObject method: public void Delete(T entity) { CustomerWebPortalEntities entities = new CustomerWebPortalEntities(); ...

VS 2010 Entity Repository Error

In my project I have it set up so that all the tables in the DB has the property "id" and then I have the entity objects inherit from the EntityBase class using a repository pattern. I then set the inheritance modifier for "id" property in the dbml file o/r designer to "overrides" Public MustInherit Class EntityBase MustOverride Pro...

DDD and MVC: Difference between 'Model' and 'Entity'

I'm seriously confused about the concept of the 'Model' in MVC. Most frameworks that exist today put the Model between the Controller and the database, and the Model almost acts like a database abstraction layer. The concept of 'Fat Model Skinny Controller' is lost as the Controller starts doing more and more logic. In DDD, there is a...

dynamically create sitemap xml using php

Hi, I have created sitemap for my site using some reference code in the below link http://stackoverflow.com/questions/2747801/creating-an-xml-sitemap-with-php But I am getting error as XML Parsing Error: undefined entity Location: as my content is as follows << alt >> attribute and it says something like < loc >http://www.example...

Is there any way to reference entity framework in silverlight?

Hi all, I have a SOA application. 1. data layer: Entity Framework 2. Service layer: WCF 3. presentation layer: silverlight Now, in silverlight I want to use data types from data layer. I cannot add a direct reference to entity framework because silverlight is using a different .net CLR. So I added a service reference hoping it will rec...

Additional parameters in mapped insert procedure - Entity Framework

Hi, I'm using Entity Framework with stored procedures mapped to insert, update and delete operations. My problem is that for example the insert procedure accepts not only columns of the entity but also additional column which is only needed for the insert procedure do it's logic. I've tried adding property to the model via VisualStudio ...

Share edmx Betwen .NET projects and C# Class Library

Hi there, I had two seperated projects that used the same database, similar methods, etc. So i've created a new solution and added those two projects. I've created an C# Class Library project and i've writed there all the methods from the other two. I've also created an edmx file for DAL layer. I've added the reference of the C# Class ...

Missing something with Entity Framework for .NET 3.5?

Is it not possible to have EF create the necessary entities when I have two related tables linked with a FK in .NET3.5SP1? I see where the checkbox to support this is disabled but it is available in .NET4. I've got a DB that has only tables with relationships in it. I need to build a Silverlight app (SL4) that allows management of the d...

AppEngine: Can I write a Dynamic property (db.Expando) with a name chosen at runtime?

If I have an entity derived from db.Expando I can write Dynamic property by just assigning a value to a new property, e.g. "y" in this example: class MyEntity(db.Expando): x = db.IntegerProperty() my_entity = MyEntity(x=1) my_entity.y = 2 But suppose I have the name of the dynamic property in a variable... how can I (1) rea...

How to escape <, >, and & characters to html entities in Oracle PL/SQL

Hi, I need to send HTML emails directly from oracle PL/SQL package. This works almost fine. I have problem with the fact that some of the data fetched from a table contain things like <S>, <L>, and similar fragments, which sometimes ar treated as HTML tags, and even if not, they are always ignored and never displayed. So, I need to e...

Problem resolving a generic Repository with Entity Framework and Castle Windsor Container

Hi, im working in a generic repository implementarion with EF v4, the repository must be resolved by Windsor Container. First the interface public interface IRepository<T> { void Add(T entity); void Delete(T entity); T Find(int key) } Then a concrete class implements the interface public class Repository<T> : IR...

MSCRM: How to create entities and set relations using the xRM linq provider

Do I need to save newly created crm entity instances before I can set relations to other crm entity instances? I'm facing the problem that after calling CrmDataContext.SaveChanges() the newly created entities are written to the database, but the relations between those newly created instances are missing in the database. What do I miss...

Mapping custom POCO in Entity Framework 4

So I have a small issue with converting a string to a boolean when EF maps to my POCO. I created custom POCOs and I have one that has a boolean property called "IsActive". But, in the database the tables column "IsActive", that maps to the POCOs property, is a string. It's either 'Y' or 'N'. EF doesn't like this, so I'm wondering if th...