public async Task<IEnumerable<Event>> GetAsync()
    {
      try
      {
        var dbContext = new DbContext();
        var eventsRepository = new EventsRepository();

        return await eventsRepository.GetAsync(dbContext);
      }
      catch (Exception ex)
      {
        _logger.LogError("Error occured: {0}", ex);
        return null;
      }
    }
    public async Task Put(string id, [FromBody]dynamic data)
    {
      try
      {
        var dbContext = new DbContext();
        var eventsRepository = new EventsRepository();

        var myEvent = await eventsRepository.GetAsync(dbContext, id);

        JValue newName = (JValue)data["Name"];


        if (!string.IsNullOrEmpty(newName?.ToString()))
        {
          await eventsRepository.UpdateAsync(dbContext, id, "Name", newName.ToString());
        }

        JValue newType = (JValue)data["Type"];
        int typeResult = 0;

        if (int.TryParse(newType?.ToString(), out typeResult))
        {
          await eventsRepository.UpdateAsync(dbContext, id, "Type", typeResult.ToString());
        }

        JValue newStartTime = (JValue)data["startsAt"];
        DateTime newTime;

        if (DateTime.TryParse(newStartTime?.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"), out newTime))
        {
          await eventsRepository.UpdateAsync(dbContext, id, "StartTime", newTime);
        }

      }
      catch (Exception ex)
      {
        _logger.LogError("Error occured: {0}", ex);
      }
    }