예제 #1
0
        public async Task <IActionResult> CreateGroup(string groupname)
        {
            var grp = new Group {
                Name = groupname
            };

            bionoContext.Groups.Add(grp);
            await bionoContext.SaveChangesAsync();

            return(Ok(grp));
        }
        public async Task <IActionResult> Post(ServiceModel model)
        {
            var service = new ServiceConfiguration
            {
                Enabled           = model.Enabled,
                ServerName        = model.ServerName,
                ResponsibleServer = model.ResponsibleServer,
                ServiceName       = model.ServiceName,
                Status            = ServiceStatus.Unchecked
            };
            await bionoContext.ServiceConfiguration.AddAsync(service);

            await bionoContext.SaveChangesAsync();

            model.Id = service.Id;
            await hubContext.Clients.Group(model.ResponsibleServer.ToLower()).AddServerConfig(model);

            return(Ok(service));
        }