poco

Entity Framework POCO with WCF software design question

大城市里の小女人 提交于 2019-12-21 18:31:53
问题 I am going to use Entity Framework and WCF in my application. The suggested practice, as I saw, is using POCO with Entity Framework and also using POCO classes as DataContracts. That is actually what POCO and Attributes are used for, -if I am not wrong. However I am asked to use seperate classses for Entity Framework POCO's and WCF DataContracts. And to use a mapper between POCO's and DataContracts. Like, Foo and FooContract with same properties. I am on the first approachs side but I wonder

Entity Framework - related ICollection getting materialized into HashSet

柔情痞子 提交于 2019-12-21 04:52:29
问题 I use EntityFramework POCO + proxies + lazy loading in my project. Today I was pretty surprized to see that the class Transaction has its related collection Rows materialized into HashSet (instead of EntityCollection ). I need EntityCollection for tracking changes in the collection. public class Transaction { public virtual ICollection<TransactionRow> Rows { get; set; } } However other entity classes have their related collection materialized into EntityCollection . I am loading the

EF4 POCO WCF Serialization problems (no lazy loading, proxy/no proxy, circular references, etc)

可紊 提交于 2019-12-21 04:34:15
问题 OK, I want to make sure I cover my situation and everything I've tried thoroughly. I'm pretty sure what I need/want can be done, but I haven't quite found the perfect combination for success. I'm utilizing Entity Framework 4 RTM and its POCO support. I'm looking to query for an entity (Config) that contains a many-to-many relationship with another entity (App). I turn off lazy loading and disable proxy creation for the context and explicitly load the navigation property (either through

In a layered architecture using Entity Framework, should I return POCO classes from the BLL? (Architecture guidance needed)

亡梦爱人 提交于 2019-12-21 00:59:26
问题 I've been reading too much probably and am suffering from some information overload. So I would appreciate some explicit guidance. From what I've gathered, I can use VS2010's T4 template thingy to generate POCO classes that aren't tied directly to the EF. I would place these in their own project while my DAL would have an ObjectContext-derived class, right? Once I have these classes, is it acceptable practice to use them in the UI layer? That is, say one of the generated classes is BookInfo

Generate POCO objects from xml file

隐身守侯 提交于 2019-12-20 12:34:04
问题 I have an XML file which roughly describes a database schema I am inheriting I want to generate POCO objects for this file to give me a head start with the business objects in my C# application. Is this possible and how? 回答1: You could (and should) define a xsd which describes your XML file. From this XSD you can generate classes using xsd.exe. If you need more control over your code generation (e.g. you aren't happy with the output of xsd.exe, want to add attributes, make changes, ...) you

DDD using STE vs POCO

旧时模样 提交于 2019-12-20 06:39:02
问题 Developing n-layered application with DDD (o better DDDD because we are using WCF) using Microsoft technology (where we have full controll of all component), the best choise seems to be STE vs POCO (this last one force the usage of DTOs). That's right? In your opinion make sense the usage of STE with DTOs where we need them? Thanks. 回答1: I really can recommend Julie Lerman's Programming Entity Framework. She goes in depth about simple poco's, dto's and Self Tracking Entities. Advantages and

Add to Existing Model based on a POCO with need to add to List<T>

。_饼干妹妹 提交于 2019-12-20 04:29:12
问题 I have a poco model that looks like this: public int Id {get; set; public string EmailAddress { get; set; } public int? GenderTypeId { get; set; } public List<FindPersonResultsViewModel> findPersonResultsViewModel { get; set; } The List FindPersonResultsViewModel contains public string FirstName { get; set; } public string LastName { get; set; } At first on a Post I have the following data public IActionResult FindPerson (FindPersonViewModel findPersonViewModel) Id : 4432 EmailAddress:

EF Reverse POCO against a SQL Database Project?

断了今生、忘了曾经 提交于 2019-12-20 03:31:12
问题 Can I use the EF Reverse POCO generator directly against a SQL Database Project? I keep my SQL database definition in a "Visual Studio SQL Database Project", which gives me some nice version control capabilities, schema comparison, and a few nifty deployment features. Sometimes I update the project files from a temporary database during development, but the version-controlled project is always the "truth" for any version. If I use the EntityFramework Reverse POCO Code First Generator, will I

EF6 POCO INotifyPropertyChanged without viewmodels

为君一笑 提交于 2019-12-20 01:58:27
问题 I have been binding in WPF application directly to the model classes (and skipping creating individual viewmodel classes). Now, after switching to EF6 and DBContext, I face an issue with the generated EF POCO classes since it looks its either kind of tricky or not even recommended trying to make INotifyPropertyChanged interface implemented directly to those classes. Currently: I don't want to go back to ObjectContext. I don't want to change T4 too much either. The suggestions on the web for

Data access layer design in DDD

不羁的心 提交于 2019-12-19 21:51:24
问题 Excuse me for my poor English. Ok, I'm thinking about DDD approach now and it sounds great but... There is one little question about it. DDD says that the domain model layer is totally decoupled from the data access layer (and all other layers). So when the DAL will save some business object it will have access to public properties of this object only. Now the question: How can we guarantee (in general) that a set of public data of an object is all we need to restore the object later? Example