public async Task <ActionResult <ApplicationMeasure> > AddApplicationMeasure([FromBody] ApplicationMeasure applicationMeasure)
        {
            await _sensorApplicationStore.CreateApplicationMeasureAsync(applicationMeasure);

            // return CreatedAtAction(
            //     nameof(GetSensorApplicationDetails),
            //     sensorApplication.GetKey(),
            //     sensorApplication);
            return(StatusCode(201));
        }
Exemple #2
0
        public async Task CreateApplicationMeasureAsync(ApplicationMeasure applicationMeasure)
        {
            using SqlConnection connection = new SqlConnection(_connectionString);
            await connection.OpenAsync();

            await connection.ExecuteAsync(
                "ApplicationMeasure_Add_tr",
                new
            {
                ApplicationMeasure = applicationMeasure.Application,
                applicationMeasure.Name,
                applicationMeasure.Description,
                applicationMeasure.UnitMeasure,
                applicationMeasure.LimitMin,
                applicationMeasure.LimitMax,
                applicationMeasure.DefaultMin,
                applicationMeasure.DefaultMax
            },
                commandType : CommandType.StoredProcedure);
        }