public void Delete()
        {
            var id = projectBL.AddProject(new Project
            {
                Title     = "Test project",
                ManagerId = 1
            });

            projectBL.DeleteProject(id);

            var project = projectBL.GetProjects().FirstOrDefault(m => m.Id == id);

            Assert.Null(project);
        }
        public IHttpActionResult DeleteProject(int id)
        {
            ProjectBL projectBl = new ProjectBL(_context);

            try
            {
                projectBl.DeleteProject(id);
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
            finally
            {
                projectBl = null;
            }
            return(Ok());
        }
Exemple #3
0
 /// <summary>
 /// Delete Project
 /// </summary>
 /// <param name="projectId"></param>
 /// <returns></returns>
 public IActionResult DeleteProject(int projectId)
 {
     projectBL.DeleteProject(projectId);
     return(RedirectToAction("ProjectDetails"));
 }
 public IHttpActionResult DeleteProject(int id)
 {
     objProjBL.DeleteProject(id);
     return(Ok());
 }