public async Task <User> CreateAsync(User user) { UserEntity userEntity = (UserEntity)user; var result = (User)await _tableContext.InsertOrMergeEntityAsync(userEntity); return(result); }
public async Task <ServiceResponse <PullRequest> > AddPrAsync(string username, string owner, string repositoryName, PullRequest pr) { PrStatus?dbStatus = null; if (pr.Status == PrStatus.Valid) { dbStatus = pr.Status; } var trackerEntry = new TrackerEntryEntity { Username = username, RowKey = $"{owner}:{repositoryName}:{pr.PrId}", Url = pr.Url, Status = dbStatus }; await _tableContext.InsertOrMergeEntityAsync(trackerEntry); var serviceResponse = new ServiceResponse <PullRequest> { ServiceResponseStatus = ServiceResponseStatus.Created }; return(serviceResponse); }
public void TestInsert() { PrEntity prEntity = new PrEntity(3, "http://test"); RepositoryEntity repositoryEntity = new RepositoryEntity("test", "test", new[] { prEntity }); UserEntity userEntity = new UserEntity(_testGuid, new List <RepositoryEntity> { repositoryEntity }); var insertedEntity = _context.InsertOrMergeEntityAsync(userEntity).Result; }
public void TestInsert() { PrEntity prEntity = new PrEntity(Constants.PR_ID, Constants.URL); RepositoryEntity repositoryEntity = new RepositoryEntity(Constants.TEST_OWNER, Constants.TEST_REPO_NAME, new List <PrEntity> { prEntity }); UserEntity userEntity = new UserEntity(Constants.USERNAME, new List <RepositoryEntity> { repositoryEntity }); var insertedEntity = _context.InsertOrMergeEntityAsync(userEntity).Result; }
public async Task <ServiceResponse> AddProjectAsync(Project project) { var projectEntity = new ProjectEntity(project); await _tableContext.InsertOrMergeEntityAsync(projectEntity); //todo: add in error handling return(new ServiceResponse { ServiceResponseStatus = ServiceResponseStatus.Ok, Message = $"The project {project.RepoName} was added." }); }
public void TestInsert() { var insertedEntity = _context.InsertOrMergeEntityAsync(_trackerEntryEntity).Result; }