public void DeleteTest() { var log = new TestLogDto().Log; Assert.DoesNotThrowAsync(() => _logLogic.Delete(new List <Guid> { log.Uuid })); }
public ActionResult Delete(string keepType) { DateTime keeyDate = DateTime.Now.StartDateTime(); if (!keepType.IsNullOrEmpty()) { switch (keepType) { case "7": keeyDate = DateTime.Now.AddDays(-7).StartDateTime(); break; case "30": keeyDate = DateTime.Now.AddMonths(-1).StartDateTime(); break; case "90": keeyDate = DateTime.Now.AddMonths(-3).StartDateTime(); break; default: keeyDate = DateTime.Now; break; } logLogic.Delete(keeyDate); return(Success()); } return(Error()); }
public async Task <ActionResult> Delete([FromQuery(Name = "uuid-collection")] Guid[] uuidCollection) { try { await _logLogic.Delete(uuidCollection.ToList()); return(StatusCode(StatusCodes.Status200OK)); } catch (Exception e) { await _logLogic.Log(e); return(StatusCode(StatusCodes.Status500InternalServerError)); } }