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

            return(ProcessResult(result));
        }
 public async Task <IActionResult> UpdatedProfile(Update.Command updatedProfile)
 {
     return(HandleResult(await Mediator.Send(new Update.Command
     {
         DisplayName = updatedProfile.DisplayName,
         Bio = updatedProfile.Bio
     })));
 }
Beispiel #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));
        }
Beispiel #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));
        }
        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());
        }
        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);
        }
Beispiel #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));
        }
Beispiel #11
0
 public void UpdateDetails(Update.Command command)
 {
     ImageUrl = command.ImageUrl;
 }
Beispiel #12
0
 public async Task <ActionResult <Profile> > Update(string userName, Update.Command command)
 {
     command.UserName = userName;
     return(await mediator.Send(command));
 }
Beispiel #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));
 }
 public async Task <ActionResult <Unit> > Update(string usuarioId, Update.Command command)
 {
     command.Id = usuarioId;
     return(await Mediator.Send(command));
 }
 public async Task <ActionResult <Unit> > Update(Guid Id, Update.Command command)
 {
     command.Id = Id;
     return(await _mediator.Send(command));
 }
Beispiel #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));
 }
Beispiel #19
0
 public async Task <IActionResult> EditBook(int id, Update.Command command)
 {
     command.BookId = id;
     return(Ok(await _mediator.Send(command)));
 }
Beispiel #20
0
        public async Task <IActionResult> Update(Update.Command request)
        {
            var response = await _mediator.Send(request);

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

            return(Ok());
        }
Beispiel #24
0
 public async Task <ActionResult <Unit> > Update(int id, Update.Command command)
 {
     command.id = id;
     return(await _mediator.Send(command));
 }
 public async Task <UserResult.Full> Update([FromRoute] Guid id, [FromBody] Update.Command command)
 {
     command.Id = id;
     return(await _mediator.Send(command));
 }
 public async Task <IActionResult> Create(Update.Command request)
 {
     return(Ok(await _mediator.Send(request)));
 }
 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));
 }
Beispiel #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));
 }