API.DataAccess.StorageManager.SetSchedule C# (CSharp) Method

SetSchedule() public method

public SetSchedule ( string scheduleJson ) : void
scheduleJson string
return void
        public void SetSchedule(string scheduleJson)
        {
            if (string.IsNullOrWhiteSpace(scheduleJson))
            {
                throw new ArgumentNullException(nameof(scheduleJson), "An empty schedule can't be put in the datastore.");
            }

            CloudBlockBlob blob = GetBlockBlob(_scheduleKey);
            blob.UploadText(scheduleJson);
        }

Usage Example

        public void SetSchedule(ServerBusSchedule schedule)
        {
            var scheduleJson = JsonConvert.SerializeObject(schedule);

            _storageManager.SetSchedule(scheduleJson);
            _cacheManager.SetSchedule(scheduleJson);
        }