Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Delete Project
 /// </summary>
 /// <param name="projectId"></param>
 /// <returns></returns>
 public IActionResult DeleteProject(int projectId)
 {
     projectBL.DeleteProject(projectId);
     return(RedirectToAction("ProjectDetails"));
 }
Ejemplo n.º 4
0
 public IHttpActionResult DeleteProject(int id)
 {
     objProjBL.DeleteProject(id);
     return(Ok());
 }