public async Task <int> UpdateAreaKeyId(AreaEndPointModel model)
 {
     using (var _dbContext = new DataBaseContext())
     {
         object[] parameters = new object[] { model.KeyId, model.Area };
         return(await _dbContext.ExecuteNonQueryAsync("sp_UpdatekeyIdAreaByName", parameters));
     }
 }
Beispiel #2
0
        public async Task <AreaEndPointModel> getAreaById(int id)
        {
            AreaEndPointModel areaEndPointModel = new AreaEndPointModel();

            using (var _context = new DataBaseContext())
            {
                object[] parameters = new object[] { id };
                var      dReader    = await _context.ExecuteReaderAsync("sp_GetKeyIdArea", parameters);

                while (dReader.Read())
                {
                    areaEndPointModel.Area  = dReader.GetString(0);
                    areaEndPointModel.KeyId = dReader.GetString(1);
                }
            }
            return(areaEndPointModel);
        }
        public async Task <IHttpActionResult> updateAreaKeyId(AreaEndPointModel model)
        {
            var result = await services.UpdateAreaKeyId(model);

            return(Ok(result));
        }