예제 #1
0
        public void deleteNgo(string NgoId)
        {
            NgoList n = _context.NgoList.Find(NgoId);

            _context.Remove(n);
            _context.SaveChanges();
        }
        public void TestUpdateNgo()
        {
            NgoList ngolist = _repo.GetNgoId("4");

            ngolist.NgoMobile = "9876567890";
            _repo.updateNgo(ngolist);
            NgoList ngolist1 = _repo.GetNgoId("4");

            Assert.AreSame(ngolist, ngolist1);
        }
예제 #3
0
 public IActionResult addNgolist(NgoList obj)
 {
     try
     {
         _repo.ngoRegistration(obj);
         return(Ok());
     }
     catch (Exception e)
     {
         return(NotFound(e.Message));
     }
 }
예제 #4
0
 public IActionResult updateNgo(NgoList ngolist)
 {
     try
     {
         _repo.updateNgo(ngolist);
         return(Ok());
     }
     catch (Exception e)
     {
         return(NotFound(e.InnerException.Message));
     }
 }
예제 #5
0
 public void updateNgo(NgoList ngolist)
 {
     _context.NgoList.Update(ngolist);
     _context.SaveChanges();
 }
예제 #6
0
 public void ngoRegistration(NgoList ngolist)
 {
     _context.Add(ngolist);
     _context.SaveChanges();
 }