Validate object based on external factors (ie. data store uniqueness)

后端 未结 4 1019
北荒
北荒 2020-11-28 07:17

Description

My solution has these projects:

  • DAL = Modified Entity Framework
  • DTO = Data Transfer objects th
4条回答
  •  悲&欢浪女
    2020-11-28 08:00

    I had this exact same problem and after trying to find a work around for days and days and days, I ended up merging my DTO, DAL, and BL into one library. I kept my presentation layer separate. Not sure if that is an option for you or not. For me, I figured that my chances of ever changing the data store were very slight, and so the separate tier wasn't really needed.

    I also have implemented the Microsoft Validation Application Block for all my DTO validations. They have a "Self Validation" method that lets you perform complex validations.

提交回复
热议问题