You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PkGuidBusiness.cs 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. using Luticate2.Utils.Business;
  2. using Luticate2.Utils.Dbo;
  3. using Test.Utils.DataAccess;
  4. using Test.Utils.Dbo.PkGuid;
  5. namespace WebTest.Business
  6. {
  7. public class PkGuidBusiness : LuCrudBusiness<LuUtilsPkGuidDataAccess, PkGuidAddDbo, PkGuidDbo, PkGuidAddDbo>
  8. {
  9. public PkGuidBusiness(LuUtilsPkGuidDataAccess dataAccess) : base(dataAccess)
  10. {
  11. }
  12. protected override LuResult<PkGuidAddDbo> CheckAdd(PkGuidAddDbo obj)
  13. {
  14. if (obj.SomeText.EndsWith("_edited"))
  15. {
  16. return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText can not end with '_edited'");
  17. }
  18. return LuResult<PkGuidAddDbo>.Ok(obj);
  19. }
  20. protected override LuResult<PkGuidAddDbo> CheckEdit(PkGuidDbo dbo, PkGuidAddDbo update)
  21. {
  22. if (!update.SomeText.EndsWith("_edited"))
  23. {
  24. return LuResult<PkGuidAddDbo>.Error(LuStatus.InputError, "someText must end with '_edited'");
  25. }
  26. return LuResult<PkGuidAddDbo>.Ok(update);
  27. }
  28. }
  29. }