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.3KB

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