public async Task <HttpResponseMessage> DeleteVetVisit(VetVisitDeleteRequest request) { client.DefaultRequestHeaders.Add("Access-Control-Allow-Origin", "*"); client.DefaultRequestHeaders.Add("Access-Control-Allow-Credentials", "true"); client.DefaultRequestHeaders.Add("Access-Control-Allow-Headers", "Access-Control-Allow-Origin,Content-Type"); var serialized = System.Text.Json.JsonSerializer.Serialize(request); var stringContent = new StringContent(serialized, Encoding.UTF8, "application/json"); var result = await client.PostAsync($"/VetVisit/delete", stringContent); return(result); }
public bool DeleteVetVisit(VetVisitDeleteRequest request) { using (ISession session = NHibernateSession.OpenSession()) { VetVisit foundVetVisit = session.Query <VetVisit>().FirstOrDefault(c => c.VetVisitId == request.VetVisitId.Value); if (foundVetVisit == null) { return(false); } foundVetVisit.Deleted = DateTime.UtcNow; using (ITransaction transaction = session.BeginTransaction()) // Begin a transaction { session.Update(foundVetVisit); // Save the user in session transaction.Commit(); // Commit the changes to the database } } return(true); }
public bool Delete([FromBody] VetVisitDeleteRequest request) { return(_VetVisitManager.DeleteVetVisit(request)); }
public bool DeleteVetVisit(VetVisitDeleteRequest request) { return(_VetVisitsRepository.DeleteVetVisit(request)); }