Search Results

Search found 9916 results on 397 pages for 'entity component'.

Page 88/397 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • WPF DataGrid duplicates new row when new item is attached to the source collection.

    - by Shimmy
    <Page> <Page.Resources> <data:Quote x:Key="Quote"/> </Page.Resources> <tk:DataGrid DataContext="{Binding Quote}" ItemsSource="{Binding Rooms}"> <tk:DataGrid/> </Page> Code: Private Sub InitializingNewItem _ (sender As DataGrid, _ ByVal e As InitializingNewItemEventArgs) _ Handles dgRooms.InitializingNewItem Dim room = DirectCast(e.NewItem, Room) 'Room is subclass of EntityObject Dim state = room.EntityState 'Detached Dim quote = Resources("Quote") state = quote.EntityState 'Unchanged 'either one of these lines causes the new row to go duplicated: quote.Rooms.Add(room) room.Quote = quote 'I tried: sender.Items.Refresh 'I also tried to remove the detached entity from the DataGrid and create a 'new item but it they throw exceptions saying the the Items is untouchable. End If

    Read the article

  • WCF Data Services implementation strategies.

    - by Nix
    Microsoft has done a savvy job of not outlining the actual place for data services in the wonderful world of SOA/Web dev. So my question is simple, are WCF Data Services designed to be used via clients? Or has anyone ever heard of someone using them on the server side? Simple scenario a general layered architecture using BO business objects (parenthesis indicate what is being passed between layers) (XML) WCF Service - (BO)Business Logic - (BO) Dao - Entity Framework or using data services it would be where DS BO are modeled business entities to be used in data service. (XML) WCF Service -(BO) Business Logic - (BO) WCF Data Service - (DS BO)Server I can't see a use for the later, unless there are going to be a lot of cases people would be accessing your data via your Data Service Layer vs the Service layer? Thoughts anyone? I have not seen any mention of using DS from within a Service Layer....

    Read the article

  • L2E many to many query

    - by 5YrsLaterDBA
    I have four tables: Users PrivilegeGroups rdPrivileges LinkPrivilege ----------- ---------------- --------------- --------------- userId(pk) privilegeGroupId(pk) privilegeId(pk) privilegeId(pk, fk) privilegeGroupId(fk) name code privilegeGroupId(pk, fk) L2E will not create LinkPrivilege entity for me. So we only have Users, PrivilegeGroups and rdPrivileges entities. PrivilegeGroups and rdPrivileges are many to many relationship. What I need to do is retrieve all code from rdPrivileges table based on a passed in userId. How can I do it? EDIT working code: var acc = from u in db.Users from pg in db.PrivilegeGroups from p in pg.rdPrivileges where u.UserId == userId && u.PrivilegeGroups.PrivilegeGroupId == pg.PrivilegeGroupId select p.Code;

    Read the article

  • How to avoid "The name 'ConfigurationManager' does not exist in the current context" error?

    - by 5YrsLaterDBA
    I am using VS2008. I have a project connect with a database and the connection string is read from App.config via ConfigurationManager. We are using L2E. Now I added a helper project, AndeDataViewer, to have a simple UI to display data from the database for testing/verification purpose. I don't want to create another set of Entity Data Model in the helper project. I just added all related files as a link in the new helper project. When I compile, I got the following error: Error 15 The name 'ConfigurationManager' does not exist in the current context C:\workspace\SystemSoftware\SystemSoftware\src\systeminfo\RuntimeInfo.cs 24 40 AndeDataViewer I think I may need to add another project setting/config related file's link to the helper project from the main project? There is no App.config file in the new helper project. But it looks I cannot add that file's link to the helper project. Any ideas?

    Read the article

  • EntityFramework EntityState and databinding along with INotifyPropertyChanged

    - by OffApps Cory
    Hello, all! I have a WPF view that displays a Shipment entity. I have a textblock that contains an asterisk which will alert a user that the record is changed but unsaved. I originally hoped to bind the visibility of this (with converter) to the Shipment.EntityState property. If value = EntityState.Modified Then Return Visibility.Visible Else Return Visibility.Collapsed End If The property gets updated just fine, but the view is ignorant of the change. What I need to know is, how can I get the UI to receive notification of the property change. If this cannot be done, is there a good way of writing my own IsDirty property that handles editing retractions (i.e. if I change the value of a property, then change it back to it's original it does not get counted as an edit, and state remains Unchanged). Any help, as always, will be greatly appreciated. Cory

    Read the article

  • EF 4.0 - Many to Many relationship - problem with deletes

    - by chugh97
    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 who has the same store Id, then it fails saying "The DELETE statement conflicted with the REFERENCE constraint \"FK_PersonStores_StoreLocations\". The conflict occurred in database \"EFMapping2\", table \"dbo.PersonStores\", column 'StoreId'.\r\nThe statement has been terminated" as it was trying to delete the StoreId but that StoreId was used for another PeronId and hence exception thrown. Person p = null; using (ClassLibrary1.Entities context = new ClassLibrary1.Entities()) { p = context.People.Where(x=> x.PersonId == 11).FirstOrDefault(); List<StoreLocation> locations = p.StoreLocations.ToList(); foreach (var item in locations) { context.Attach(item); context.DeleteObject(item); context.SaveChanges(); } }

    Read the article

  • ASP.Net RADs: Dynamic Data alternatives

    - by SDReyes
    Hi Guys! We have a set of tables and views that merely store some config data for embedded devices. this schema is change-prone and do not really required lots of logic, beyond some validation rules. so we considered using a RAD tool for maintaining these CRUDS. In first stage: Dynamic Data But the community size, books absence and the last modification dates of the MSDN articles (~July 2008) makes me want to hear your experiences. (actually DynamicData comes as a part of the ASP.Net MVC2 project) What has been your experience with Dynamic Data? And... What is your favorite ASP.Net RAD alternative? Why? Thank you in advance guys! PD: Entity framework friendliness is a bonus : )

    Read the article

  • Properties in partial class not appearing in Data Sources window!

    - by Tim Murphy
    Entity Framework has created the required partial classes. I can add these partial classes to the Data Sources window and the properties display as expected. However, if I extend any of the classes in a separate source file these properties do not appear in the Data Sources window even after a build and refresh. All properties in partial classes across source files work as expected in the Data Sources window except when the partial class has been created with EF. EDIT: After removing the offending table for edm designer, adding back in it all works are expected. Hardly a long term solution. Anyone else come across a similar problem?

    Read the article

  • Entitiy Framework: "Update Database from Model" instead of "Generate Database from Model"

    - by David
    Hey everyone, I have created a Entity Framework 4 model with Visual Studio 2010 and generated a database from it. Now I found myself adding new properties (with default values), changing documentation of columns, changing names of columns, changing types of columns several times. All tasks that do not require much "extra work" in order not to be possible to be achieved automatically (in my humble opinion). Everytime I did "Generate Database from Model" and lost of course the table data. Is there a way just to update the database's architecture so to say - leaving the table data untouched? Maybe with some user interaction especially when changing types etc.? Or would this functionality be simply too difficult to be realized to work in a reliable way? Thanks in advance! Cheers, David

    Read the article

  • ORM For .Net ON Oracle

    - by moi_meme
    I'm gonna start a new project soon, using .Net 3.5 and Winform on an Oracle database. We were planning on using an ORM, NHibernate was suggested by our architect. Since I'm personnaly more familiar with Entity Framework, i thought it would be easier to use than NHibernate. But since there aren't any official provider from Oracle, we are resistant on using it. So my Question, I Looked at different provider available and found some: DevArt DataDirct EFOracleProvider So I'd like to have some feed back on each of them, pros and con, missing feature, stuff like that, from those using them, and know if we're better of with NHibernate? Thanks for the help.

    Read the article

  • Problems publishing website

    - by Oxymoron
    Recently I've began experimenting with ASP.NET MVC and the Entity Framework. Since my hostingprovider only provides me with MySQL I've been trying to set that up. Locally everything works fine, but after I publish it I get the following error: [ProviderIncompatibleException: The store provider factory type 'MySql.Data.MySqlClient.MySqlClientFactory' does not implement the IServiceProvider interface. Use a store provider that implements this interface.] Since I'm rather inexperienced with the configuring this and google is lacking a good answer I thought I'd try here. My best guess is something missing in the web.config file, but can't really make out what it is. Any help would be greatly appreciated!

    Read the article

  • LINQ To Entities - Items, ItemCategories & Tags

    - by Simon
    Hi There, I have an Entity Model that has Items, which can belong to one or more categories, and which can have one or more tags. I need to write a query that finds all tags for a given ItemCategory, preferably with a single call to the database, as this is going to get called fairly often. I currently have: Dim q = (From ic In mContext.ItemCategory _ Where ic.CategoryID = forCategoryID _ Select ic).SelectMany(Function(cat) cat.Items).SelectMany(Function(i) i.Tags) _ .OrderByDescending(Function(t) t.Items.Count).ToList This is nearly there, apart from it doesn't contain the items for each tag, so I'd have to iterate through, loading the item reference to find out how many items each tag is related to (for font sizing). Ideally, I want to return a List(Of TagCount), which is just a structure, containing Tag as string, and Count as integer. I've looked at Group and Join, but I'm not getting anywhere so any help would be greatly appreciated!

    Read the article

  • How to leverage concurrency checking with EF 4.0 POCO Self Tracking Entities in a N-Tier scenario?

    - by Mark Lindell
    I'm using VS1010RC with the POCO self tracking T4 templates. In my WCF update service method I am using something similar to the following: using (var context = new MyContext()) { context.MyObjects.ApplyChanges(myObject); context.SaveChanges(); } This works fine until I set ConcurrencyMode=Fixed on the entity and then I get an exception. It appears as if the context does not know about the previous values as the SQL statement is using the changed entities value in the WHERE clause. What is the correct approach when using ConcurrencyMode=Fixed?

    Read the article

  • EF4 generates invalid script

    - by Jaxidian
    When I right-click in a .EDMX file and click Generate Database From Model, the resulting script is obviously wrong because of the table names. What it generates is the following script. Note the table names in the DROP TABLE part versus the CREATE TABLE part. Why is this inconsistent? This is obviously not a reusable script. What I created was an Entity named "Address" and an Entity named "Company", etc (all singular). The EntitySet names are pluralized. The "Pluralize New Objects" boolean does not change this either. So what's the deal? For what it's worth, I originally generated the EDMX by pointing it to a database that had tables with non-pluralized names and now that I've made some changes, I want to go back the other way. I'd like to have the option to go back and forth as neither the db-first nor the model-first model is ideal in all scenarios, and I have the control to ensure that there will be no merging issues from multiple people going both ways at the same time. -- -------------------------------------------------- -- Dropping existing FOREIGN KEY constraints -- NOTE: if the constraint does not exist, an ignorable error will be reported. -- -------------------------------------------------- ALTER TABLE [Address] DROP CONSTRAINT [FK_Address_StateID-State_ID]; GO ALTER TABLE [Company] DROP CONSTRAINT [FK_Company_AddressID-Address_ID]; GO ALTER TABLE [Employee] DROP CONSTRAINT [FK_Employee_BossEmployeeID-Employee_ID]; GO ALTER TABLE [Employee] DROP CONSTRAINT [FK_Employee_CompanyID-Company_ID]; GO ALTER TABLE [Employee] DROP CONSTRAINT [FK_Employee_PersonID-Person_ID]; GO ALTER TABLE [Person] DROP CONSTRAINT [FK_Person_AddressID-Address_ID]; GO -- -------------------------------------------------- -- Dropping existing tables -- NOTE: if the table does not exist, an ignorable error will be reported. -- -------------------------------------------------- DROP TABLE [Address]; GO DROP TABLE [Company]; GO DROP TABLE [Employee]; GO DROP TABLE [Person]; GO DROP TABLE [State]; GO -- -------------------------------------------------- -- Creating all tables -- -------------------------------------------------- -- Creating table 'Addresses' CREATE TABLE [Addresses] ( [ID] int IDENTITY(1,1) NOT NULL, [StreetAddress] nvarchar(100) NOT NULL, [City] nvarchar(100) NOT NULL, [StateID] int NOT NULL, [Zip] nvarchar(10) NOT NULL ); GO -- Creating table 'Companies' CREATE TABLE [Companies] ( [ID] int IDENTITY(1,1) NOT NULL, [Name] nvarchar(100) NOT NULL, [AddressID] int NOT NULL ); GO -- Creating table 'People' CREATE TABLE [People] ( [ID] int IDENTITY(1,1) NOT NULL, [FirstName] nvarchar(100) NOT NULL, [LastName] nvarchar(100) NOT NULL, [AddressID] int NOT NULL ); GO -- Creating table 'States' CREATE TABLE [States] ( [ID] int IDENTITY(1,1) NOT NULL, [Name] nvarchar(100) NOT NULL, [Abbreviation] nvarchar(2) NOT NULL ); GO -- Creating table 'Employees' CREATE TABLE [Employees] ( [ID] int IDENTITY(1,1) NOT NULL, [PersonID] int NOT NULL, [CompanyID] int NOT NULL, [Position] nvarchar(100) NOT NULL, [BossEmployeeID] int NULL ); GO -- -------------------------------------------------- -- Creating all PRIMARY KEY constraints -- -------------------------------------------------- -- Creating primary key on [ID] in table 'Addresses' ALTER TABLE [Addresses] ADD CONSTRAINT [PK_Addresses] PRIMARY KEY ([ID] ); GO -- Creating primary key on [ID] in table 'Companies' ALTER TABLE [Companies] ADD CONSTRAINT [PK_Companies] PRIMARY KEY ([ID] ); GO -- Creating primary key on [ID] in table 'People' ALTER TABLE [People] ADD CONSTRAINT [PK_People] PRIMARY KEY ([ID] ); GO -- Creating primary key on [ID] in table 'States' ALTER TABLE [States] ADD CONSTRAINT [PK_States] PRIMARY KEY ([ID] ); GO -- Creating primary key on [ID] in table 'Employees' ALTER TABLE [Employees] ADD CONSTRAINT [PK_Employees] PRIMARY KEY ([ID] ); GO -- -------------------------------------------------- -- Creating all FOREIGN KEY constraints -- -------------------------------------------------- -- Creating foreign key on [StateID] in table 'Addresses' ALTER TABLE [Addresses] ADD CONSTRAINT [FK_Address_StateID_State_ID] FOREIGN KEY ([StateID]) REFERENCES [States] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Address_StateID_State_ID' CREATE INDEX [IX_FK_Address_StateID_State_ID] ON [Addresses] ([StateID]); GO -- Creating foreign key on [AddressID] in table 'Companies' ALTER TABLE [Companies] ADD CONSTRAINT [FK_Company_AddressID_Address_ID] FOREIGN KEY ([AddressID]) REFERENCES [Addresses] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Company_AddressID_Address_ID' CREATE INDEX [IX_FK_Company_AddressID_Address_ID] ON [Companies] ([AddressID]); GO -- Creating foreign key on [AddressID] in table 'People' ALTER TABLE [People] ADD CONSTRAINT [FK_Person_AddressID_Address_ID] FOREIGN KEY ([AddressID]) REFERENCES [Addresses] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Person_AddressID_Address_ID' CREATE INDEX [IX_FK_Person_AddressID_Address_ID] ON [People] ([AddressID]); GO -- Creating foreign key on [CompanyID] in table 'Employees' ALTER TABLE [Employees] ADD CONSTRAINT [FK_Employee_CompanyID_Company_ID] FOREIGN KEY ([CompanyID]) REFERENCES [Companies] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Employee_CompanyID_Company_ID' CREATE INDEX [IX_FK_Employee_CompanyID_Company_ID] ON [Employees] ([CompanyID]); GO -- Creating foreign key on [BossEmployeeID] in table 'Employees' ALTER TABLE [Employees] ADD CONSTRAINT [FK_Employee_BossEmployeeID_Employee_ID] FOREIGN KEY ([BossEmployeeID]) REFERENCES [Employees] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Employee_BossEmployeeID_Employee_ID' CREATE INDEX [IX_FK_Employee_BossEmployeeID_Employee_ID] ON [Employees] ([BossEmployeeID]); GO -- Creating foreign key on [PersonID] in table 'Employees' ALTER TABLE [Employees] ADD CONSTRAINT [FK_Employee_PersonID_Person_ID] FOREIGN KEY ([PersonID]) REFERENCES [People] ([ID]) ON DELETE NO ACTION ON UPDATE NO ACTION; -- Creating non-clustered index for FOREIGN KEY 'FK_Employee_PersonID_Person_ID' CREATE INDEX [IX_FK_Employee_PersonID_Person_ID] ON [Employees] ([PersonID]); GO -- -------------------------------------------------- -- Script has ended -- --------------------------------------------------

    Read the article

  • WPF: "Items collection must be empty before using ItemsSource."

    - by Zack Peterson
    I'm trying to get images to display in a WPF ListView styled like a WrapPanel as described in this old ATC Avalon Team article: How to Create a Custom View. When I try to populate the ListView with a LINQ-to-Entities queried collection of ADO.NET Entity Framework objects I get the following exception: Exception Items collection must be empty before using ItemsSource. My code… Visual Basic Private Sub Window1_Loaded(...) Handles MyBase.Loaded ListViewImages.ItemsSource = From g In db.Graphic _ Order By g.DateAdded Ascending _ Select g End Sub XAML <ListView Name="ListViewImages" SelectionMode="Single" ItemsSource="{Binding}"> <local:ImageView /> </ListView> I put a breakpoint on that line. ListViewImages.ItemsSource is Nothing just before the LINQ assignment.

    Read the article

  • Using non primitive types in ServiceOperation for WCF Data Service (3.5SP1)

    - by Nix
    Is there any way at all to create a "mock" entity type for use in a WCF Service Operation? We have some queries we do that we need to optimize by exposing as a ServiceOperation. The problem is in order to do so we would result in a very long list of primitative types... Ex SomeoneHelpMe(int time, string name, string address, string i, string purple, string foo, int stillGoing, int tooMany, etc...) And we really need to reduce this to SomeoneHelpedMe(CustomEntityNotMappedToAnything e) This would also help us when it comes time to write some complex queries since there is a 3 param limitation... I saw this will be possible in 4.0 using "complex types", but i am still in the 3.5SP1 world. Let me know if anyone needs more information.

    Read the article

  • One repository per table or one per functional section?

    - by Ian Roke
    I am using ASP.NET MVC 2 and C# with Entity Framework 4.0 to code against a normalised SQL Server database. A part of my database structure contains a table of entries with foreign keys relating to sub-tables containing drivers, cars, engines, chassis etc. I am following the Nerd Dinner tutorial which sets up a repository for dinners which is fair enough. Do I do one for drivers, one for engines, one for cars and so on or do I do one big one for entries? Which is the best practise for this type of work? I am still new to this method of coding.

    Read the article

  • Parallel EntityFramework

    - by mehanik
    Is it possible to make some work in parallel with entity framework for following example? using (var dbContext = new DB()) { var res = (from c in dbContext.Customers orderby c.Name select new { c.Id, c.Name, c.Role } ).ToDictionary(c => c.Id, c => new Dictionary<string, object> { { "Name",c.Name }, { "Role", c.Role } }); } For exampe what will be changed if I add AsParrallel? using (var dbContext = new DB()) { var res = (from c in dbContext.Customers orderby c.Name select new { c.Id, c.Name, c.Role } ).AsParallel().ToDictionary(c => c.Id, c => new Dictionary<string, object> { { "Name",c.Name }, { "Role", c.Role } }); }

    Read the article

  • Passing an instantiated class to concrete class derived by Castle Windsor

    - by Tr1stan
    I have a system that I'm using to test some new architecture. I have the following setup (In MVC2 .Net - C Sharp): View < Controller < Service < Repository < DB I'm using Castle Windsor as my DI (IoC) controller, and this is working just fine in both the Service and Repo layers. However, I'm now at a point where I would like to pass an Entity Framework (DatabaseNameEntity) to the constructor to the Service, and then to the Repo, so that I have something similar to a Unit of Work pattern per request (This feels like what I'm trying to achieve anyway) - and I'm having trouble working out how this can be done using Castle Windsor. Am I going off on a silly tangent? Any pointers appreciated.

    Read the article

  • Multiple join query in eSql

    - by Syma
    Hi guys, This is my first question in stackoverflow but really not the first time to get solution here. I am struggling with multiple join in entity framework 4. I have three tables (Accounts, Users and AccountUsers) that am finding difficult to query. What I want is to get all the users for the provided accountId including the account creator. I can get all the account users with no problem but the hard side for me is getting the account creator since it's not added to AccountUsers table. below is a quick preview how the tables are related. Accounts AccountId UserId (account creator) ...other columns Users UserId ...other columns AccountUsers AccountId UserId I would prefer the query to be esql, but Linq to Entities will do. I trust you guys on stackoverflow, so I know this won't take long to get the 'Answer' mark. Thanks for even reading.

    Read the article

  • ASP.NET EnqityDataSource WhereParameters, creates new property.

    - by Alex
    I am trying to populate GridView, using EntityDataSource(code behind), I need to able to sort GridView. However when I sort i get error: A property with name 'aspnet_Users.UserId1' does not exist in metadata for entity type So I beleive it is because I generate where parameter in code behind: ActiveEnqDataSource.WhereParameters.Add(new SessionParameter("aspnet_Users.UserId", TypeCode.Object, "UserName")); Full code is : ActiveEnqDataSource.ConnectionString = db.Connection.ConnectionString; ActiveEnqDataSource.DefaultContainerName = "Entities"; ActiveEnqDataSource.EntitySetName = "Enquiries"; ActiveEnqDataSource.Include = "UserCars.CarModel.CarMake, Category, aspnet_Users"; ActiveEnqDataSource.EnableUpdate = true; ActiveEnqDataSource.EnableInsert = true; ActiveEnqDataSource.EnableDelete = true; ActiveEnqDataSource.AutoGenerateWhereClause = true; ActiveEnqDataSource.WhereParameters.Add(new SessionParameter("aspnet_Users.UserId", TypeCode.Object, "UserName")); Any suggestions? Thank you very much! The gridview itself renders perfectly, only thing I cannot sort it, any "whereParameters" I add, Add 1 to the property e.g UserId1,EnquiryStatus1, ProdauctName1. etc...

    Read the article

  • Change notification in EF EntityCollection

    - by Savvas Sopiadis
    Hi everybody! In a Silverlight 4 proj i'm using WCF RIA services, MVVM principles and EF 4. I 'm running into this situation: created an entity called Category and another one called CategoryLocale (automated using VS, no POCO). The relation between them is 1 to N respectively (one Category can have many CategoryLocales), so trough this relationship one can implement master-detail scenarios. Everytime i change a property in the master record (Category) i get a notifypropertychanged notification raised. But: whenever i change a property in the detail (CategoryLocales) i don't get anything raised. The detail part is bound to a Datagrid like this: <sdk:DataGrid Grid.Row="3" Grid.ColumnSpan="2" ItemsSource="{Binding SelectedRecord.CategoryLocales,Mode=TwoWay}" AutoGenerateColumns="False" VerticalScrollBarVisibility="Auto" > Any help is appreciated! Thanks in advance

    Read the article

  • How would I best address this object type heirachy? Some kind of enum heirarchy?

    - by FerretallicA
    I'm curious as to any solutions out there for addressing object heirarchies in an ORM approach (in this instance, using Entity Framework 4). I'm working through some docs on EF4 and trying to apply it to a simple inventory tracking program. The possible types for inventory to fall into are as follows: INVENTORY ITEM TYPES: Hardware PC Desktop Server Laptop Accessory Input (keyboards, scanners etc) Output (monitors, printers etc) Storage (USB sticks, tape drives etc) Communication (network cards, routers etc) Software What recommendations are there for handling enums in a situation like this? Are enums even the solution? I don't really want to have a ridiculously normalised database for such a relatively simple experiment (eg tables for InventoryType, InventorySubtype, InventoryTypeToSubtype etc). I don't really want to over-complicate my data model with each subtype being inherited even though no additional properties or methods are included (except PC types which would ideally have associated accessories and software but that's probably out of scope here). It feels like there should be a really simple, elegant solution to this but I can't put my finger on it. Any assistance or input appreciated!

    Read the article

  • How to convert an EntityCollection<T> to List<POCOObj>

    - by ggomez
    I have Entity Framework entities Events which have an EntityCollection of RSVP. I want to convert the EntityCollection of RSVP to a generic List< of a POCO class RSVP. So I want EntityCollection - List. What would be the best way to go about achieving this? So far I have this (it's missing the RSVP part) var events = from e in _entities.Event.Include("RSVP") select new BizObjects.Event { EventId = e.EventId, Name = e.Name, Location = e.Location, Organizer = e.Organizer, StartDate = e.StartDate, EndDate = e.EndDate, Description = e.Description, CreatedBy = e.CreatedBy, CreatedOn = e.CreatedOn, ModifiedBy = e.ModifiedBy, ModifiedOn = e.ModifiedOn, RSVPs = ??? }; Thanks.

    Read the article

  • many-to-many, poco, ef4

    - by Lari13
    I have 3 entities: Goods [GID(PK), GoodName] Persons [PID(PK), PersonName] Roles [RID(PK), RoleName] But now I need to associate these object with each other. In other words, each Good can have MANY Persons in MANY Roles. For example: Book (GID#1), can have 3 associated persons: 1. Jack (PID#1) in role Author (RID#1) 2. Jack (PID#1) in role Editor (RID#2) 3. Bill (PID#2) in role Painter (RID#3) How can it be done in POCO format in Entity Framework 4?

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >