private Artifact GetArtifact(CreateArtifactModel createArtifactModel) { return(new Artifact { Title = createArtifactModel.Title }); }
public async Task <int> CreateArtifact(CreateArtifactModel createArtifactModel) { if (createArtifactModel != null) { return(await _artifactRepo.SaveArtifact(createArtifactModel).ConfigureAwait(false)); } return(-1); }
public Artifact CreateArtifact(CreateArtifactModel createArtifactModel) { return(new Artifact { Title = createArtifactModel.Title, Status = ArtifactStatus.ToDo, Type = createArtifactModel.Type, Reward = createArtifactModel.Reward, Bonus = createArtifactModel.Bonus, MemberId = createArtifactModel.MemberId, CommunityId = createArtifactModel.CommunityId }); }
public async Task <IActionResult> CreateArtifact([FromBody] CreateArtifactModel createArtifactModel) { if (ModelState.IsValid) { var artifactId = await _artifactService.CreateArtifact(createArtifactModel).ConfigureAwait(false); if (artifactId != -1) { return(Created("", $"{Request.GetDisplayUrl()}/{artifactId}")); } return(BadRequest("Something went wrong !")); } return(BadRequest("Something went wrong !")); }
public async Task <int> SaveArtifact(CreateArtifactModel artifactModel) { var artifact = _modelFactory.CreateArtifact(artifactModel); return(await _artifactDao.SaveArtifact(artifact).ConfigureAwait(false)); }