コード例 #1
0
 public OperationResult <bool> Delete(int id)
 {
     if (id <= 0)
     {
         return(new OperationResult <bool>("Invalid id", Logger.LogEvent("Invalid id")));
     }
     try
     {
         var repository = new SellerRepository();
         var seller     = repository.ReadById(id);
         if (seller != null)
         {
             repository.Delete(id);
             return(new OperationResult <bool>(true));
         }
         else
         {
             return(new OperationResult <bool>("The specified id was not found", Logger.LogEvent("The specified id was not found")));
         }
     }
     catch (Exception ex)
     {
         return(new OperationResult <bool>("Error deleting the seller", Logger.LogEvent("Error deleting the seller")));
     }
 }
コード例 #2
0
 public void Delete(int id)
 {
     _repository.Delete(id);
 }
コード例 #3
0
 public Response Delete(long SellerID)
 {
     return(repo.Delete(SellerID));
 }