예제 #1
0
        public bool Handle(UpdateLibraryInHubCommand cmd)
        {
            Name        = cmd.Name;
            Description = cmd.Description;

            return(Name.ToUpper() == cmd.Name.ToUpper() && Description.ToUpper() == cmd.Description.ToUpper());
        }
예제 #2
0
 public bool Handle(UpdateLibraryInHubCommand cmd) => GetLibrary(cmd.LibraryId).Handle(cmd);
        public async Task <IActionResult> UpdateLibraryInHub(string hubId, string libId, [FromBody] UpdateLibraryInHubCommand details)
        {
            details.HubId     = hubId;
            details.LibraryId = libId;

            var result = await _mediator.Send(details);

            if (string.IsNullOrEmpty(result))
            {
                return(NotFound());
            }

            var library = await _mediator.Send(new GetLibraryByIdQuery(hubId, libId));

            return(Ok(library));
        }