public static EntityType CreateEntityTypeFrom(UpdateEntityTypeCommand cmd) => new EntityType { Id = cmd.Id, Name = cmd.Name, SupportedDocuments = cmd.SupportedDocumentTypesIds .Select(id => new EntityTypeDocumentType { DocumentTypeId = id }).ToList() };
public IActionResult Put([FromBody] UpdateEntityTypeCommand msg) => updateCommand.Execute(msg).Match( Succ: x => x.Match <IActionResult>(Ok, BadRequest), Fail: ex => StatusCode(500, ex));