Ejemplo n.º 1
0
 private Artifact GetArtifact(CreateArtifactModel createArtifactModel)
 {
     return(new Artifact
     {
         Title = createArtifactModel.Title
     });
 }
Ejemplo n.º 2
0
 public async Task <int> CreateArtifact(CreateArtifactModel createArtifactModel)
 {
     if (createArtifactModel != null)
     {
         return(await _artifactRepo.SaveArtifact(createArtifactModel).ConfigureAwait(false));
     }
     return(-1);
 }
Ejemplo n.º 3
0
 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
     });
 }
Ejemplo n.º 4
0
        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 !"));
        }
Ejemplo n.º 5
0
        public async Task <int> SaveArtifact(CreateArtifactModel artifactModel)
        {
            var artifact = _modelFactory.CreateArtifact(artifactModel);

            return(await _artifactDao.SaveArtifact(artifact).ConfigureAwait(false));
        }