public IHttpActionResult GetSubjectByName(string name) { var subject = subjectRepo.GetByName(name); if (subject == null) { return(Content(HttpStatusCode.NotFound, "Item does not exist")); } return(Ok(subject)); }
public void testAdd() { //Arrange int count = repo.All().Count(); // Act this.repo.Add(entity); this.repo.SaveChanges(); // Assert Assert.NotNull(repo.GetByName(n)); this.repo.HardDelete(entity); this.repo.SaveChanges(); }