예제 #1
0
        public async Task <bool> DeleteSmsRequestAsync(ISmsEntity reuqest)
        {
            try
            {
                await _tableStorage.DeleteAsync(SmsEntity.Create(reuqest));

                return(true);
            }
            catch (Exception e)
            {
                await _log.WriteError(Component, "Delete sms", null, e, DateTime.UtcNow);
            }
            return(false);
        }
예제 #2
0
        public static SmsEntity Create(ISmsEntity entity)
        {
            var result = new SmsEntity
            {
                SmsServiceStatus = entity.SmsServiceStatus,
                DateRow          = entity.DateRow,
                PhoneNumer       = entity.PhoneNumer,
                PhoneOperator    = entity.PhoneOperator,
                RowId            = entity.RowId,
                ParentRowId      = entity.ParentRowId,
                PartitionKey     = entity.SmsServiceStatus.ToString(),
                RowKey           = entity.DateRow,
                Message          = entity.Message,
                Atempt           = entity.Atempt
            };
            var tableEntity = entity as ITableEntity;

            if (tableEntity != null)
            {
                result.ETag = tableEntity.ETag;
            }
            return(result);
        }