Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(Update.Command command, Guid id)
        {
            command.ActivityId = id;
            var result = await Mediator.Send(command);

            return(ProcessResult(result));
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> UpdatedProfile(Update.Command updatedProfile)
 {
     return(HandleResult(await Mediator.Send(new Update.Command
     {
         DisplayName = updatedProfile.DisplayName,
         Bio = updatedProfile.Bio
     })));
 }
Ejemplo n.º 3
0
        public async Task <ActionResult <Unit> > UpdateStatus(Update.Command command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            return(await Mediator.Send(command));
        }
        public async Task <ActionResult <Unit> > Update(string document, Update.Command command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            command.Document = document;
            return(await Mediator.Send(command));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> UpdateTask(Update.Command query)
        {
            _logger.LogInformation("Start CreateTask query");

            var task = await _mediator.Send(query);

            _logger.LogInformation("End CreateTask query");

            return(CreatedAtAction(null, new { TaskId = task.Id }, task));
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Put(
            [FromRoute] Guid id,
            [FromBody] NoteDto note)
        {
            var command = new Update.Command(id, note.Title, note.Body);

            var response = await _mediator.Send(command);

            return(Ok());
        }
        public async Task <ActionResult <CreateSessionResponse> > Update(
            [FromBody] CreateSessionCommand commandDTO,
            [FromRoute] string id
            )
        {
            Logger.LogDebug($"Update session with id {id}");
            var command = new Update.Command(
                id,
                commandDTO.Genres,
                commandDTO.Name
                );
            var result = await Mediator.Send(command);

            return(Ok(result));
        }
        public async Task <IActionResult> Update(Guid?id, [FromBody] Update.Command command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = await Mediator.Send(command);

            if (!result.IsValid)
            {
                return(BadRequest(result.Errors));
            }

            return(Ok());
        }
Ejemplo n.º 9
0
        public void UpdateDetailsForUser()
        {
            var user = new ApplicationUser
            {
                Email    = _testUsername,
                Name     = _testName,
                ImageUrl = _testImageUrl
            };
            var userCommand = new Update.Command
            {
                ImageUrl = _testNewImageUrl
            };

            user.UpdateDetails(userCommand);

            Assert.Equal(_testNewImageUrl, user.ImageUrl);
        }
Ejemplo n.º 10
0
        public async Task <IActionResult> Update([FromRoute] string personId, [FromBody] PersonBindingModel bindingModel)
        {
            var command = new Update.Command(personId)
            {
                FirstName = bindingModel.FirstName,
                LastName  = bindingModel.LastName,
                Gender    = bindingModel.Gender
            };

            command.SetUserName(User.Identity.Name);
            var result = await _mediator.Send(command);

            // Will create a separate log file for the specific date and category, if you want to categorized the logs
            //Log.Information($"Update API endpoint was called from {this.GetType().Name} by {User.Identity.Name}" + ",{Name}", this.GetType().Name);
            Log.Information($"Update API endpoint was called from {this.GetType().Name} by {User.Identity.Name}" + " | {Name}", this.GetType().Name);

            return(Ok(result));
        }
Ejemplo n.º 11
0
 public void UpdateDetails(Update.Command command)
 {
     ImageUrl = command.ImageUrl;
 }
Ejemplo n.º 12
0
 public async Task <ActionResult <Profile> > Update(string userName, Update.Command command)
 {
     command.UserName = userName;
     return(await mediator.Send(command));
 }
Ejemplo n.º 13
0
 public async Task <ActionResult <Unit> > UpdateForum(Update.Command command, int id)
 {
     command.Id = id;
     return(await Mediator.Send(command));
 }
 public async Task <ActionResult <Unit> > UpdateThread(Update.Command command, int threadId)
 {
     command.Id = threadId;
     return(await Mediator.Send(command));
 }
Ejemplo n.º 15
0
 public async Task <ActionResult <Unit> > Update(string usuarioId, Update.Command command)
 {
     command.Id = usuarioId;
     return(await Mediator.Send(command));
 }
Ejemplo n.º 16
0
 public async Task <ActionResult <Unit> > Update(Guid Id, Update.Command command)
 {
     command.Id = Id;
     return(await _mediator.Send(command));
 }
Ejemplo n.º 17
0
 public async Task <ActionResult <Unit> > UpdatePost(Update.Command command, int postId)
 {
     command.PostId = postId;
     return(await Mediator.Send(command));
 }
 public async Task <ActionResult <Unit> > Edit(Guid id, Update.Command command)
 {
     command.Id = id;
     return(await Mediator.Send(command));
 }
Ejemplo n.º 19
0
 public async Task <IActionResult> EditBook(int id, Update.Command command)
 {
     command.BookId = id;
     return(Ok(await _mediator.Send(command)));
 }
Ejemplo n.º 20
0
        public async Task <IActionResult> Update(Update.Command request)
        {
            var response = await _mediator.Send(request);

            return(Ok(response));
        }
Ejemplo n.º 21
0
 public async Task <ActionResult <Unit> > Put(Update.Command command)
 {
     return(await Mediator.Send(command, CancellationToken.None));
 }
Ejemplo n.º 22
0
 public async Task <ActionResult <Unit> > Update(Guid bookId, Update.Command command)
 {
     command.BookId = bookId;
     return(await Mediator.Send(command));
 }
Ejemplo n.º 23
0
        public async Task <IActionResult> Update([FromBody] Update.Command command)
        {
            await _mediator.Send(command);

            return(Ok());
        }
Ejemplo n.º 24
0
 public async Task <ActionResult <Unit> > Update(int id, Update.Command command)
 {
     command.id = id;
     return(await _mediator.Send(command));
 }
Ejemplo n.º 25
0
 public async Task <UserResult.Full> Update([FromRoute] Guid id, [FromBody] Update.Command command)
 {
     command.Id = id;
     return(await _mediator.Send(command));
 }
Ejemplo n.º 26
0
 public async Task <IActionResult> Create(Update.Command request)
 {
     return(Ok(await _mediator.Send(request)));
 }
Ejemplo n.º 27
0
 public async Task <ActionResult <Unit> > Update(Update.Command command)
 {
     return(await Mediator.Send(command));
 }
 public async Task <ActionResult <Unit> > UpdateForumCategory(Update.Command command, int forumCategoryId)
 {
     command.Id = forumCategoryId;
     return(await Mediator.Send(command));
 }
Ejemplo n.º 29
0
 public async Task <StatusAction> UpdateCategory(Update.Command command) => await Mediator.Send(command);
 public async Task <ActionResult <Unit> > Put(Update.Command command, CancellationToken cancellationToken)
 {
     return(await this.Mediator.Send(command, cancellationToken));
 }