data-access-layer

Data access layer design in DDD

馋奶兔 提交于 2019-12-01 18:44:35
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 We have the following business rules: User and domain must be provided for the business object on

What is DTO equivalent term for objects returned from DAL?

孤街醉人 提交于 2019-12-01 11:51:14
I'm already using DTO's for data transfer over a network. Now I'm also introducing different DTO-like classes to the DAL. This is to avoid passing the application (business) objects across layers. To avoid naming confusion, I would like to use another term than DTO but can't find a good one. What is DTO equivalent term for objects returned from DAL? "What's in a name? that which we call a rose by any other name would smell as sweet." - William Shakespeare Also, what Martin Fowler says about POJO: In the talk we were pointing out the many benefits of encoding business logic into regular java

Dal (with Entity Framework) and Model layers into MVC

时间秒杀一切 提交于 2019-12-01 11:36:13
First of all , I use EF into Dal layer (separeted project from MVC, same solution). The generated models from EF's EDMX file are the actual models from Model layer?? If so, how do I access these models to work in MVC's View layer? I think it's wrong accessing data layer directly from view to work with these models, and If I make a Model layer with "my models" and translate Dal's models into mine models... it'll be duplicated code. Probably I'm getting something wrong, but most of egs. are with code first approach, and I can't figure out this. You are right in your idea of not accessing access

Using dynamic where clauses in Entity Framework

痴心易碎 提交于 2019-12-01 09:35:16
I am trying to re-design a data access layer that was originally built using Raptier. Raptier generats methods that accept a where clause as a parameter to be passed in to a stored proc. I really need to retain the existing mesthos signatures, so my new DAL needs to accept where clauses as well. I want to use the more up-to-date data access technologies and techniques, so was thinking about using Entity Framework from .Net 4.0. However, it doesn't look like I can accept dynamic where clauses without implementing some intense reoutines to parse them into lamba expressions. Is there something I

Using dynamic where clauses in Entity Framework

不打扰是莪最后的温柔 提交于 2019-12-01 09:04:32
问题 I am trying to re-design a data access layer that was originally built using Raptier. Raptier generats methods that accept a where clause as a parameter to be passed in to a stored proc. I really need to retain the existing mesthos signatures, so my new DAL needs to accept where clauses as well. I want to use the more up-to-date data access technologies and techniques, so was thinking about using Entity Framework from .Net 4.0. However, it doesn't look like I can accept dynamic where clauses

Where to place the entity framework in our solution?

南楼画角 提交于 2019-12-01 06:24:36
Okay, so we have a solution that contains the following projects: BusinessLogic Entities DataAccess Utilities UnitTests UserInterface It is a very large enterprise-level application. My question is, where do we put the entity framework? On one hand EF seems like a data access technology and should go in the DataAccess project. But then on the other hand it generates its own entities and those should be placed in our already large Entities project. Which project is the better place for Entity Framework? Is it possible to split up the entities from the persistence logic in EF? Place EDMX file to

How to read dynamic properties from database

不羁岁月 提交于 2019-12-01 05:16:32
I will try to explain my scenario the best way I can. I have the following tables in my database: Products{ProductId, CategoryId ...} Categories{CategoryId ...} CategoryProperties{CategoryPropertyId, CategoryId, Name ...} PropertyValues{ProductId, CategoryPropertyId, Value ...} So the goal is to have list of products which belongs to some category and each category can have 'n' number of properties with values in the 'PropertyValues' table. I have a query that returns data based on 'categoryId' so I can always get different results from the database: For the CPU category: intel i7 | CPU |

Where to place the entity framework in our solution?

a 夏天 提交于 2019-12-01 04:06:34
问题 Okay, so we have a solution that contains the following projects: BusinessLogic Entities DataAccess Utilities UnitTests UserInterface It is a very large enterprise-level application. My question is, where do we put the entity framework? On one hand EF seems like a data access technology and should go in the DataAccess project. But then on the other hand it generates its own entities and those should be placed in our already large Entities project. Which project is the better place for Entity

C# Handle on SQL Server Message Output [duplicate]

一个人想着一个人 提交于 2019-12-01 03:43:41
This question already has an answer here: Capture Stored Procedure print output in .NET 3 answers When executing scripts in SQL Server Management Studio, messages are often generated that display in the message window. For example when running a backup of a database: 10 percent processed. 20 percent processed. Etc... Processed 1722608 pages for database 'Sample', file 'Sampe' on file 1. 100 percent processed. Processed 1 pages for database 'Sample', file 'Sample_Log' on file 1. BACKUP DATABASE successfully processed 1722609 pages in 202.985 seconds (66.299 MB/sec). I would like to be able to

How to read dynamic properties from database

不羁岁月 提交于 2019-12-01 03:26:06
问题 I will try to explain my scenario the best way I can. I have the following tables in my database: Products{ProductId, CategoryId ...} Categories{CategoryId ...} CategoryProperties{CategoryPropertyId, CategoryId, Name ...} PropertyValues{ProductId, CategoryPropertyId, Value ...} So the goal is to have list of products which belongs to some category and each category can have 'n' number of properties with values in the 'PropertyValues' table. I have a query that returns data based on