title: Error 'Device' not contain a definition for 'GetAwaiter' in the controller MVC
body: <p>In the next code </p>
  
  <pre><code> [HttpPost]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Create([Bind(Include = "DispositivoID,Nombre,ClaveDispositivo,Activo,EmpresaID")] Modelo.Dispositivo dispositivo)
      {
          if (ModelState.IsValid)
          {
              //string deviceId = "minwinpc";
              Device device;
              try
              {
                  device =  await registryManager.AddDeviceAsync(new Device(dispositivo.Nombre)).Result;
  
              }
              catch (DeviceAlreadyExistsException)
              {
                  device = await registryManager.GetDeviceAsync(dispositivo.Nombre).Result;
              }
  
              dispositivo.ClaveDispositivo = device.Authentication.SymmetricKey.PrimaryKey;
              db.Dispositivos.Add(dispositivo);
              db.SaveChanges();
              return RedirectToAction("Index");
          }
  
          ViewBag.EmpresaID = new SelectList(db.Empresas, "EmpresaID", "Nombre", dispositivo.EmpresaID);
          return View(dispositivo);
      }
  </code></pre>
  
  <p>I have the next error:</p>
  
  <blockquote>
    <p>Error CS1061  'Device' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'Device' could be found (are you missing a using directive or an assembly reference?)   </p>
  </blockquote>
  
  <p>In "Device" there are:</p>
  
  <pre><code>using System;
  using Microsoft.Azure.Devices.Common;
  using Newtonsoft.Json;
  using Newtonsoft.Json.Converters;
  
  namespace Microsoft.Azure.Devices
  {
      public class Device : IETagHolder
      {
          public Device();
          public Device(string id);
  
          [JsonProperty(PropertyName = "authentication")]
          public AuthenticationMechanism Authentication { get; set; }
          [JsonProperty(PropertyName = "cloudToDeviceMessageCount")]
          public int CloudToDeviceMessageCount { get; }
          [JsonConverter(typeof(StringEnumConverter))]
          [JsonProperty(PropertyName = "connectionState")]
          public DeviceConnectionState ConnectionState { get; }
          [JsonProperty(PropertyName = "connectionStateUpdatedTime")]
          public DateTime ConnectionStateUpdatedTime { get; }
          [JsonProperty(PropertyName = "etag")]
          public string ETag { get; set; }
          [JsonProperty(PropertyName = "generationId")]
          public string GenerationId { get; }
          [JsonProperty(PropertyName = "deviceId")]
          public string Id { get; }
          [JsonProperty(PropertyName = "lastActivityTime")]
          public DateTime LastActivityTime { get; }
          [JsonConverter(typeof(StringEnumConverter))]
          [JsonProperty(PropertyName = "status")]
          public DeviceStatus Status { get; set; }
          [JsonProperty(PropertyName = "statusReason")]
          public string StatusReason { get; set; }
          [JsonProperty(PropertyName = "statusUpdatedTime")]
          public DateTime StatusUpdatedTime { get; }
      }
  }
  </code></pre>