public async Task Delete(String taskID, String projectName)
        {
            CloudTable table = await _cloudTableHelper.GetCloudTableByName(_configuration["TasksTableName"]);

            ProjectTask task = new ProjectTask
            {
                ETag         = "*",
                PartitionKey = projectName,
                RowKey       = taskID
            };

            await _cloudTableHelper.DeleteAsync <ProjectTask>(table, task);
        }
Ejemplo n.º 2
0
        public async Task <Boolean> DeleteAsync(String projectID)
        {
            CloudTable table = await _cloudTableHelper.GetCloudTableByName(_configuration["TableName"]);

            Project project = new Project
            {
                ETag         = "*",
                PartitionKey = _partitionKey,
                RowKey       = projectID
            };

            TableResult result = await _cloudTableHelper.DeleteAsync <Project>(table, project);

            return(result.HttpStatusCode >= (Int32)HttpStatusCode.OK && result.HttpStatusCode <= (Int32)HttpStatusCode.IMUsed);
        }
        public async Task <Boolean> CreateAsync(User user)
        {
            TableStorageUser userToStore = new TableStorageUser
            {
                HashedPassword = user.PasswordHash,
                PartitionKey   = _partitionKey,
                RowKey         = user.NormalizedUserName.ToUpper(),
                Timestamp      = DateTime.Now,
                UserName       = user.UserName,
            };

            CloudTable table = await _cloudTableHelper.GetCloudTableByName(_configuration["UsersTable"]);

            TableStorageUser savedUser = await _cloudTableHelper.InsertEntityAsync(table, userToStore);

            return(savedUser != null);
        }