entity-framework

Silverlight Datagrid paging issue

SL4 provides following items for datapaging: DataPager control, PagedCollectionView to wrap data for datapager, DomainDatasource for paging, sort and filter in xaml. Question: 1.With Datapager, data only loaded for specific page, no more data cached, no more extra code needed, rightt? Even data come from SP with EF, if the data wrapp...

Need help using entities for ASP.NET MVC 2 framework

I'm making a site in ASP.NET MVC 2 using C#. I designed a database with a bunch of tables that have many to many relationships, similar to the following: GrandParent - many to many - Parent and Parent - many to many - Child I used the Entity Framework to make all of the entities class and am now working on a function in a repositor...

Problems With Entity Framework Queries

I write a Class, it's has some query. attention, the whereitem is a little class, its Body member include a Expression<Fun<T,bool>> lambda expression is used to filter the query public override List<T> Find<T>(int start, int len = 10, IWhereItem<T> whereitem = null, IOrderItem<T> orders = null, bool isDetach = true) { var context = ge...

How can I add stored function to Entity Framework

Hi to all. I'm trying to add a sql (stored) function to Entity Framework, but unsuccessfully. I tried with right clicking on a table in .edmx and "Function Import", but the function is not shown there, although I added it (updated model from the database). Does anyone have solution for this? ...

Entity Framework POCO Entities in n-tier web application

I'm new to EF4 and haven't had any experience with it before. So, bare with me if this is very simple question. I have my POCO entities (.tt file) in BOL, the .edmx file (EDM) in DAL and my webapp in Presentation layer. All the business logic goes to BLL layer. Here are the references: UI->BLL-DAL-BOL BLL->DAL-BOL DAL->BOL BOL->None of ...

Return one record from my Model based on two parameters sent to my repository asp.net mvc 2

I pass two parameters to my repository to return one record I am strugling to wite the code to return one record. Here is my repository- public Classifieds_Ads GetUserClassifiedDetailsToModify(int classifiedid, Guid UserGuid) { return context.Classifieds_Ads.Where(c => c.User.Id == UserGuid && c => c.CatID == cla...

WPF Prism Entity Frameword repository

Hi., I am a bit lost. Im building a WPF application using the PRISM guidance, I want to use the Entity Framework 4 for a data repository. I have previously developed a Silverlight app. using Prism and WCF RIA Services which worked great as all my components is decoupled. So what is the best way of getting data in my WPF application in...

Entity framework migration to Oracle

Is it possible to migrate from SQL Provider in Entity Framework (1.0) to an Oracle provider ? Or is there a blog or MSDN page which describes the steps to swap providers ? ...

A better way to "Clear" all tables using Entity Framework.

Hi currently when I want to clear my tables I use brute force: inventario_dboEntities inv = new inventario_dboEntities(); foreach (var item in inv.espiromex_dampers) { inv.DeleteObject(item); } foreach (var item in inv.espiromex_detalles) { inv.DeleteOb...

Exposing EF Model to a variety of clients

Hey guys, I hope everyone is doing well. I have (more-less) a broad question referring to exposing a model to various clients. Here is my situation: I have a model (sitting on top of Oracle) that is created using EF 4.0 and 3rd party Oracle provider. The model resides in a library so it can be easily referenced by multiple projects. ...

WCF Repository Service pattern with entity framework

I need presentation layer in silverlight, asp.net etc , so everything is through wcf services. I have number of doubts in my implementation of repository layer, service layer, wcf services things i currently do I have repository , its not per table its created per aggregate root I have service layer its for doing a group of actions in...

Saving Dropdown list selection with Entity Framework in ASP.NET MVC solution

Hi, I'm looking for advice on a decent pattern for dropdown list selection and persistence of the selection with POCO EF please. I have a list of IEnumerable<Country> in my view model where Country is a POCO loaded via EF. There is an Address property on the view model that takes the current or user selected value on it's Country prop...

Entity Framework 4.0 - Many to Many Relationship

Hello, I have probably stupid question but how Can I create Many-To-Many relationship with create option "Model First". I have read this article http://learnentityframework.com/LearnEntityFramework/tutorials/many-to-many-relationships-in-the-entity-data-model/ but here the autor haven't provided to much description and It is "Database...

How do you submit objects with a many to many relationship using the Entities Framwork?

This is a follow up question to this question I asked yesterday. I've tracked down exactly the issue I think is causing me grief and I think I can explain the situation with more clarity. I just can't seem to figure out how to write objects with a many to many relationship to a SQL database using the Entities Framework in a C# ASP.NET M...

(DevForce vs OpenAccess vs LLBLGen) vs Entity Framework 4 & CTP4

Putting free open source ORM/DataAccess/Modeling tools (like NHibernate) aside, what do some similar commercial tools offer beyond what the current Entity Framework 4 (plus CTP4) offers. Commercial ones in mind are Telerik's OpenAccess, IdeaBlade's DevForce and LLBLGen Pro. Instead of asking separate question per product, I have them a...

How to use the DeleteDatabase function in Entities Framework 4?

How can I easily delete all tables from my database (C# ASP.NET MVC 2 using SQL)? I created models to the data with the entities framework and have figured out how to insert data. When I try Entity1 test = new Entity1(); test.DeleteDatabase(); I get this error: Unable to complete operation. The supplied SqlConnection does not s...

Using SQL Server 2008 R2 with Visual Studio Express

I want to create either "LINQ to SQL" classes or use "Entity Framework" from Visual Studio Express 2010. When I attempt to add a data source my only options are: "Microsoft Access Database File" "Microsoft SQL Server Compact 3.5" "Microsoft SQL Server Database File" Do I need VS2010 Pro to use LINQ to SQL or EF? I thought I could d...

Compilied queries with return anonymous type.

Hello, Is it possible to return anonymous type from compiledQuery in linq to entity framework. If yes can you please post solution sample. Thanks Venkat ...

Entity framework with oracle database

Hi, I'm using entity framework with oracle database. I downloaded the provider from http://oracleef.codeplex.com/. Today I converted my project to work with VS2010. Is there a way (free) to work with oracle db using VS2010? Thanks! ...

Entity Framework 4 Mapping to POCOs

I've created a new entity data model of my database and manually created the POCO objects for this to map to and it all seems to work fine. The problem is I now want to rename the properties in my POCO objects to differ from the field names in the database e.g I want UserID rather than user_id, when I do this obviously EF then can no lo...