コード例 #1
0
        public async Task EditAsync(EditTravelViewModel model)
        {
            var query = TableOperation.Retrieve <TravelModel>(model.PartitionKey, model.RowKey);


            TravelModel newModel = new TravelModel(model.PartitionKey, model.RowKey)
            {
                Title   = model.Title,
                Content = model.Content,
            };
            await _storageTableClient.EditAsync <TravelModel>(newModel);
        }
コード例 #2
0
        public async Task <string> CreateAsync(CreateTravelViewModel model)
        {
            var         id      = Guid.NewGuid();
            TravelModel tvModel = new TravelModel(model.UserName, id.ToString())
            {
                Title   = model.Title,
                Content = model.Content,
            };
            await _storageTableClient.CreateAsync <TravelModel>(tvModel);

            return(id.ToString());
        }