Example #1
0
        public async Task <ActionResult <ProjectsResponse> > GetCompletedProjects(bool completed)
        {
            try
            {
                var projects = await projectClass.GetCompletedProjects(completed);

                if (projects.Count() == 0)
                {
                    projectsResponse = new ProjectsResponse
                    {
                        StatusCode = 400,
                        Message    = "Something went wrong, Try again or List not Available"
                    };

                    return(NotFound(projectsResponse));
                }
                else
                {
                    projectsResponse = new ProjectsResponse
                    {
                        StatusCode   = 200,
                        Message      = "Successfully Executed",
                        ResponseData = projects
                    };
                    return(Ok(projectsResponse));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }