dto

DTO to Entity And Entity to DTO

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We're to use DTO's to send data to and from the presentation layer. We have layers like: facade appService domain And We have use Dozer to help us convert entity to dto. But i have 2 question now: from entity to dto we can use dozer, but from dto to entity can we use dozer? If Yes, How? Where shoud i create entity? in facade or DTOAssembler? for example,I have to register a book. the book Entity look's like: Book{ public Book(BookNumber number,String name){ //make sure every book has a business number, //and the number can't change once the

What is the difference between DAL, DTO and DAO in a 3 tier architecture style including with MVC

巧了我就是萌 提交于 2019-12-03 03:05:30
Recently I was learning about ORM (Object Relational Mapping) and the 3 tier architecture style (presentation,business and data persistence ). If I understand correctly, I can separate the data persistence layer into DTO and DAO layer. I would like to understand, how the following parts works together in a data persistence layer. DAL (Data Access Layer) DTO (Data Transfer Object) DAO (Data Access Object) In a top of that I learnt that In larger applications MVC is the presentation tier only of an N-tier architecture. I got really confused, how it can be even possible for example in a 3 tier

Entity Framework and DTO

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Im planning to use the Entities generated by the EF (POCO) in sending data to the client instead of creating DTOs? Is this a good practice? Basically, my EDMX file is on my DAL layer. So the UI will have direct access on my DAL. Thanks. 回答1: Basically, I don't think it's a good idea to send DAL objects to your interface, so I would use DTOs. To minimize the effort doing so I would take a look at an DTO generator , to generate DTO code which lets you convert from DAL object to DTO and vice versa. EDIT: Sorry, didn't see you are using POCO.

C# MongoDB: How to correctly map a domain object?

♀尐吖头ヾ 提交于 2019-12-03 02:44:42
问题 I recently started reading Evans' Domain-Driven design book and started a small sample project to get some experience in DDD. At the same time I wanted to learn more about MongoDB and started to replace my SQL EF4 repositories with MongoDB and the latest official C# driver. Now this question is about MongoDB mapping. I see that it is pretty easy to map simple objects with public getters and setters - no pain there. But I have difficulties mapping domain entities without public setters. As I

Domain Entities, DTO, and View Models

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an ASP.NET MVC 2 application with a POCO domain model and an NHibernate repository layer. My domain model has no awareness of my viewmodels so I use automapper to go from viewmodel to entity and vice/versa. When I introduced WCF to my project (a late requirement), I started having to deal with disconnected objects. That is, I retrieve an entity from the database with NHibernate and once that entity is serialized it becomes disconnected and each child collection is loaded regardless of whether or not I plan on using it meaning I'm

Pass DTO Object to Angular Modal

匿名 (未验证) 提交于 2019-12-03 01:39:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So, I have a child modal that I want to pass a DTO Object to as argument, the line would be such as: [routerLink]="['/', { outlets: { popup: 'apiDosageDialogFirstStep/'+ formDTO } }]" I've learned the hard way that there is (or was) apparently no way to transfer complex objects via routerLink. However the reply I find mostly is like the one on this question , which is not useful to me as my object is a Data Transfer one and has no physical reference on a database to query for So, I'd like to know if anyone has faced similar issue and what

DDD: Should a Dto Assembler be a part of Domain Layer?

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Thanks in advance. I have some Aggregates in the Domain Layer library. Also, some DTO s in a separate library, which is shared between Server and Client side. An Aggregate of an entity is more informative than its DTO . So, in order to convert from DTO to Aggregate , a repository should be accessed by a Dto Assembler . Interfaces of repositories are in Domain Layer . That's why i come to conclusion that DtoAssembler should be a part of DomainLayer . Is this right? 回答1: No, this would be plain wrong in the context of DDD. Try asking a (non

How to get access to inherited object properties in WCF?

匿名 (未验证) 提交于 2019-12-03 00:54:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The case is: [ServiceContract] public interface IInfo { [DataMember] int Id{get;set;} } [DataContract] [KnownType(typeof(Legal))] public class Info { [DataMember] public int Id { get; set; } } [DataContract] public class Legal : Info { [DataMember] public string ManagerName { get; set; } } [ServiceContract] [ServiceKnownType(typeof(Legal))] public interface IMyService { [OperationContract] int DoWork(Info dto); } [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class MyService :

Value Objects in CQRS - where to use

痴心易碎 提交于 2019-12-03 00:33:28
问题 Let's say we have CQRS-inspired architecture, with components such as Commands, Domain Model, Domain Events, Read Model DTOs. Of course, we can use Value Objects in our Domain Model. My question is, should they also be used in: Commands Events DTOs I haven't seen any examples where Value Objects (VO) are used in the components mentioned above. Instead, primitive types are used. Maybe it's just the simplistic examples. After all, my understanding of VOs use in DDD is that they act as a glue

What is the difference between an MVC Model object, a domain object and a DTO

随声附和 提交于 2019-12-03 00:14:06
问题 What is the difference between a MVC Model object, a domain object and a DTO? My understanding is: MVC Model object: Models the data to be displayed by a corresponding view. It may not map directly to a domain object, i.e. may include data from one or more domain objects. Client side May contain business logic. Eg. validations, calculated properties, etc No persistence related methods Domain object: An object that models real-world object in the problem domain like Reservation, Customer,