Пример #1
0
        public async Task <ActionResult> AddOrDeleteProject(AddProject model)
        {
            if (model.isDelete)
            {
                var project = await _services.GetFirstProject(model.Status, model.URL);

                if (project != null)
                {
                    await _services.DeleteProject(project);

                    return(Redirect("/"));
                }
                return(NotFound());
            }
            var NewProject = new Projects
            {
                Status = model.Status,
                Url    = model.URL
            };
            await _services.AddProject(NewProject);

            return(Redirect("/"));
        }