public override async Task <int> HandleCommand(DeleteCommand request, CancellationToken cancellationToken) { return(await farmerRepository.Delete(DeleteBuild(new Farmer() { Id = request.FarmerId }, request.LoginSession))); }
public async Task <bool> DeleteFarmerAsync(int id) { try { var entity = await _FarmerRepository.GetEntityByIdAsync(id); _FarmerRepository.Delete(entity); if (await _uow.SaveChangesAsync() == 1) { return(true); } return(false); } catch (Exception e) { throw e; } }