Ejemplo n.º 1
0
        public async Task Save(Project project)
        {
            project.PartitionKey = _partitionKey;
            project.Timestamp    = DateTime.Now;
            project.RowKey       = project.ProjectName;
            CloudTable table = await _cloudTableHelper.GetCloudTableByName(_configuration["TableName"]);

            Project savedProject = await _cloudTableHelper.InsertEntityAsync(table, project);
        }
        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);
        }
        public async Task SaveNewTask(ProjectTaskEntity newTask)
        {
            CloudTable table = await _cloudTableHelper.GetCloudTableByName(_configuration["TasksTableName"]);

            await _cloudTableHelper.InsertEntityAsync <ProjectTaskEntity>(table, newTask);
        }