public IActionResult Post([FromBody] Application item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            _context.Applications.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetApplication", new { name = item.Name }, item));
        }
        public ProjectController(ApplicationVersionTracking.Data.ApplicationContext context)
        {
            _context = context;

            if (_context.Applications.Count() == 0)
            {
                _context.Projects.Add(new Project {
                    Name = "Default", TFprojID = "proj1234"
                });
                _context.SaveChanges();
            }
        }
        public ApplicationController(ApplicationVersionTracking.Data.ApplicationContext context)
        {
            _context = context;

            if (_context.Applications.Count() == 0)
            {
                _context.Applications.Add(new Application {
                    Name = "Default", ProjectID = 1, StatusTypeID = 1, ActiveTFRelease = "rel0000"
                });
                _context.SaveChanges();
            }
        }
        public EventTypeController(ApplicationVersionTracking.Data.ApplicationContext context)
        {
            _context = context;

            if (_context.Applications.Count() == 0)
            {
                _context.EventTypes.Add(new EventType {
                    Description = "Default"
                });
                _context.SaveChanges();
            }
        }
Beispiel #5
0
        public EventController(ApplicationVersionTracking.Data.ApplicationContext context)
        {
            _context = context;

            if (_context.Applications.Count() == 0)
            {
                _context.Events.Add(new Event {
                    ApplicationID = 1, EnvironmentTypeID = 1, ServerID = 1, EventTypeID = 1, EventDate = DateTime.Now
                });
                _context.SaveChanges();
            }
        }
Beispiel #6
0
        public IActionResult Create([FromBody] Event item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            _context.Events.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetEvent", new { id = item.ID }, item));
        }
        public IActionResult Create([FromBody] Server item)
        {
            if (item == null)
            {
                return(BadRequest());
            }

            _context.Servers.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetServer", new { name = item.Name }, item));
        }
        public ServerController(ApplicationVersionTracking.Data.ApplicationContext context)
        {
            _context = context;

            if (_context.Applications.Count() == 0)
            {
                _context.Servers.Add(new Server {
                    Name = "Default", StatusTypeID = 1
                });
                _context.SaveChanges();
            }
        }