예제 #1
0
 public async Task AddAsync(string userId, ProductInfo productInfo)
 {
     productInfo.Id           = DateTime.Now.Ticks;
     productInfo.RowKey       = productInfo.Id.ToString();
     productInfo.PartitionKey = userId;
     await _repository.Insert(productInfo);
 }
예제 #2
0
 public async Task AddAsync(long productId, ProductInfoHistory history)
 {
     history.Id           = DateTime.Now.Ticks;
     history.RowKey       = history.Id.ToString();
     history.PartitionKey = productId.ToString();
     await _repository.Insert(history);
 }
예제 #3
0
        public async Task <Post> Add(Post entity)
        {
            entity.PartitionKey = GetPartitionKey(entity);
            entity.RowKey       = Guid.NewGuid().ToString();
            await azureTableStorage.Insert(entity);

            return(entity);
        }
 public async Task Insert(InsertVehicleDetailsInput input)
 {
     if (Guid.Empty == input.VehicleId)
     {
         throw new ArgumentNullException("Empty vehicle id");
     }
     await _repository.Insert(_mapper.Map <VehicleDetails>(input));
 }
예제 #5
0
 public async Task AddAsync(UserProfile userProfile)
 {
     userProfile.Id           = DateTime.Now.Ticks;
     userProfile.RowKey       = userProfile.Id.ToString();
     userProfile.PartitionKey = userProfile.UserId;
     userProfile.LastNotificationEmailSendOn = DateTime.Now.AddDays(-1);
     await _repository.Insert(userProfile);
 }
예제 #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public async Task <bool> SaveComment(CommentRequest model)
        {
            model.PartitionKey = "MapApp";
            model.RowKey       = model.Email;

            await _repository.Insert(model);

            return(true);
        }
예제 #7
0
 public async Task CreateAsync(Note record)
 {
     var newRecord = new JsonValueTableEntity
     {
         Value        = record.ToJson(),
         PartitionKey = PartitionKey,
         RowKey       = record.RowId
     };
     await _repository.Insert(newRecord);
 }
예제 #8
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            this.InsertedCustomer.RowKey = Guid.NewGuid().ToString();
            await TableStorage.Insert(tableName, this.InsertedCustomer);

            return(RedirectToPage(routeName));
        }
예제 #9
0
        public async Task <IActionResult> Privacy()
        {
            var currentUser = await _context.Users.FirstOrDefaultAsync(u => u.UserName == User.Identity.Name);

            var date         = DateTime.UtcNow;                                                //UTC para evitar problemas
            var reverseTicks = string.Format("{0:D19}", DateTime.MaxValue.Ticks - date.Ticks); //Formateado a la misma cantidad de dígitos

            var log = new Log(currentUser.Id, reverseTicks)
            {
                Message = $"User has opened Privacy page at ({date.ToLongDateString()})"
            };
            await _logStorage.Insert(log);

            return(View());
        }
예제 #10
0
        public async Task SaveBlogInfo(Blog blog)
        {
            blog.RowKey       = "primary";
            blog.PartitionKey = "blogs";
            var exists = await azureTableStorage.GetItem("blogs", "primary");

            if (exists != null)
            {
                await azureTableStorage.Update(blog);
            }
            else
            {
                await azureTableStorage.Insert(blog);
            }
        }
예제 #11
0
        public async Task WriteData()
        {
            var result = GetTempDataAsync();

            try
            {
                var item = new JsonValueTableEntity()
                {
                    Value        = result,
                    PartitionKey = "partitionKey",
                    RowKey       = Guid.NewGuid().ToString()
                };

                await _azure.Insert(item);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public async Task <bool> AddQueue(PickupQueue queue)
        {
            queue.Name = queue.Name.ToLowerInvariant();

            return(await _client.Insert(queue));
        }
예제 #13
0
 public Task SaveAsync(SensorDataMessage message)
 {
     return(repository.Insert(message));
 }
예제 #14
0
 public async virtual Task Insert(T entity)
 {
     await tableStorage.Insert(entity);
 }
예제 #15
0
 public async Task <bool> Save(ulong guildId, string host, int port = default)
 {
     return(await _client.Insert(new Server(guildId, host, port)));
 }
예제 #16
0
 public async Task <bool> Flag(IGuildUser user, string reason)
 {
     return(await _client.Insert(new FlaggedSubscriber(user) { Reason = reason }));
 }
 public void Warning(LoggingWarningMessage message)
 {
     _warningRepository.Insert(message);
 }
 public void Informational(LoggingInfoMessage message)
 {
     _informationalRepository.Insert(message);
 }
 public void Error(LoggingErrorMessage message)
 {
     _errorRepository.Insert(message);
 }
 public void Debug(LoggingDebugMessage message)
 {
     _debugRepository.Insert(message);
 }