您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }