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

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