public int ManageReportedPetAlert(string code, int action) { var request = new PetAlertReportManageRequest { Code = Guid.Parse(code), Action = action }; return(_petSearchServiceClient.ManageReportedPetAlert(request)); }
public async Task <int> Post(PetAlertReportManageRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } return(await _petSearchProvider.ManageReportedPetAlertAsync(request) .ConfigureAwait(false)); }
public async Task <int> ManageReportedPetAlertAsync(PetAlertReportManageRequest request) { int records; using (var dbConnection = _dbConnectionFactory.Open()) { using (var trans = dbConnection.OpenTransaction()) { var petAlert = await dbConnection.SingleAsync <PetAlertTableModel>(p => p.Code == request.Code) .ConfigureAwait(false); var action = request.Action; records = await dbConnection.UpdateOnlyAsync(new PetAlertTableModel { AlertStatus = action }, x => x.AlertStatus, x => x.Id == petAlert.Id) .ConfigureAwait(false); trans.Commit(); } } return(records); }
public int ManageReportedPetAlert(PetAlertReportManageRequest request) { return(_findMyPetClient.JsonClient().Post(request)); }