Ejemplo n.º 1
0
        public async Task <ApiResponse <PutResult <Guid> > > Put([FromBody] ActorInputDto dto)
        {
            var key = await _actorService.Put(dto);

            var result = new PutResult <Guid>(key);

            return(ApiResponse.OK(result));
        }
Ejemplo n.º 2
0
        public async Task <int> Create(ActorInputDto inputDto)
        {
            var temp = mapper.Map <Actor>(inputDto);

            actorRepository.Insert(temp);
            await actorRepository.Save();

            return(temp.Id);
        }
Ejemplo n.º 3
0
        public async Task <ApiResponse <PatchResult> > Patch(string name, [FromBody] ActorInputDto dto)
        {
            var patched = await _actorService.Patch(name, dto);

            var result = new PatchResult(patched);

            if (patched <= 0)
            {
                return(ApiResponse.NotFound(Response, "actor not found", result));
            }
            return(ApiResponse.OK(result));
        }
Ejemplo n.º 4
0
 public async Task <OutDto> GetUserInfoByActor(ActorInputDto input)
 {
     if (ActorData == null)
     {
         ActorData = await helloRepository.GetData();
     }
     ActorData.Index++;
     if (ActorData.Index == 10)
     {
         ActorData.DeleteModel();
     }
     return(await Task.FromResult(new OutDto()
     {
         Word = $"hello {input.Name},your id is {ActorData.Index}"
     }));
 }
Ejemplo n.º 5
0
 public async Task  Create(ActorInputDto inputDto)
 {
     await actorService.Create(inputDto);
 }