Exemple #1
0
 void Start()
 {
     instance = this;
     Init();
     sm                  = new SyncManager(processCallback);
     pubgSocket          = new PubgSocket();
     pubgSocket.callBack = ReceiveData;
     pubgSocket.Init();
     pubgSocket.InitTimer(sm);
     postEngine = new PostEngine();
     postEngine.RegisterEvent();
 }
        public IActionResult PostEngine([FromBody] PostEngine model)
        {
            if (ModelState.IsValid)
            {
                var command = new AddEngine(model.Name, model.Power, model.Torque, model.Cylinders, model.Displacement, model.FuelType);
                commandBus.AddCommand(command);
                commandBus.InvokeCommandsQueue();

                var result = GetEngineDetails(command.Id);
                return(CreatedAtRoute(
                           "GetEngine",
                           new { engineId = command.Id },
                           result
                           ));
            }

            return(BadRequest(ModelState));
        }
Exemple #3
0
        public string GeneratePostText(AdmissionsByAgePostModel model)
        {
            var text = PostEngine.Run(model).Result;

            return(text);
        }
        public string GeneratePostText(TrendsPostModel model)
        {
            var text = PostEngine.Run(model).Result;

            return(text);
        }