public async Task <IActionResult> Add([FromBody] CreateGroupCommand createGroup) { return(GetResponseOnlyResultMessage(await Mediator.Send(createGroup))); }
public async Task <IActionResult> Add([FromBody] CreateGroupCommand createGroup) { var result = await Mediator.Send(createGroup); return(result.Success ? Ok(result.Message) : BadRequest(result.Message)); }
public async Task <ActionResult <int> > Create(CreateGroupCommand command) { return(await Mediator.Send(command)); }
public async Task <IActionResult> CreateGroupAsync([FromBody] CreateGroupCommand createGroupCommand) { var id = await _mediator.Send(createGroupCommand); return(Ok(id)); }
public void TestInitialize() { var factory = AssemblyConfiguration.Kernel.Get <CommandFactory>(); _sut = factory.GetInstance <CreateGroupCommand>(); }
public GroupTableModel(int groupId, CreateGroupCommand request) { this.Id = groupId; this.name = request.Name; this.link = request.Link; }
public async Task <IActionResult> Create([FromBody] CreateGroupCommand command) { var productId = await Mediator.Send(command); return(CreatedAtAction("Get", new { id = productId })); }
public async Task <ActionResult <Guid> > CreateGroup(CreateGroupCommand request) { var result = await Mediator.Send(request); return(CreatedAtRoute("GetGroup", new { Id = result }, result)); }
public async Task <ActionResult <GroupViewModel> > Create([FromBody] CreateGroupCommand command) { var vm = await Mediator.Send(command); return(Ok(vm)); }
public async Task <ActionResult <ResponseWrapper> > CreateGroupAsync([FromBody] CreateGroupCommand command) { var result = await _mediator.Send(command); return(Ok(ResponseWrapper.CreateOkResponseWrapper(result))); }
public async Task <ActionResult <GroupModel> > CreateGroup([FromBody] CreateGroupCommand command) { GroupModel newGroup = await Mediator.Send(command); return(Ok(newGroup)); }
public AddGroupViewModel() { Group = new LogGroup(); CreateGroupCommand = new CreateGroupCommand(this); EditGroupCommand = new EditGroupCommand(this); }
public async Task <IActionResult> Create([FromBody] CreateGroupCommand command) { await Mediator.Send(command); return(NoContent()); }
public static GroupAggregateRoot Register(IWorkContext context, CreateGroupCommand command, DepartmentAggregateRoot department) { return(new GroupAggregateRoot(command.AggregateId).Create(context, command, department)); }
public async Task <ActionResult <int> > Create([FromBody] CreateGroupCommand command) { var groupId = await Mediator.Send(command); return(Ok(groupId)); }
public GroupMutation() { Name = "GroupMutation"; this.FieldAsyncWithScope <StringGraphType, string>( "create", arguments: new QueryArguments ( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "name" } ), resolve: async(ctx, mediator) => { var command = new CreateGroupCommand() { Name = ctx.GetString("name") }; var id = await mediator.Send(command); return(id); } ); this.FieldAsyncWithScope <BooleanGraphType, bool>( "delete", arguments: new QueryArguments ( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "id" } ), resolve: async(ctx, mediator) => { var command = new DeleteGroupCommand() { Id = ctx.GetString("id") }; await mediator.Send(command); return(true); } ); this.FieldAsyncWithScope <BooleanGraphType, bool>( "update", arguments: new QueryArguments ( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "id" }, new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "name" } ), resolve: async(ctx, mediator) => { var command = new UpdateGroupCommand() { Id = ctx.GetString("id"), Name = ctx.GetString("name") }; await mediator.Send(command); return(true); } ); this.FieldAsyncWithScope <BooleanGraphType, bool>( "addUser", arguments: new QueryArguments ( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "userId" }, new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "groupId" } ), resolve: async(ctx, mediator) => { var command = new AddUserToGroupCommand() { UserId = ctx.GetString("userId"), GroupId = ctx.GetString("groupId") }; await mediator.Send(command); return(true); } ); this.FieldAsyncWithScope <BooleanGraphType, bool>( "removeUser", arguments: new QueryArguments ( new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "userId" }, new QueryArgument <NonNullGraphType <StringGraphType> > { Name = "groupId" } ), resolve: async(ctx, mediator) => { var command = new RemoveUserFromGroupCommand() { UserId = ctx.GetString("userId"), GroupId = ctx.GetString("groupId") }; await mediator.Send(command); return(true); } ); }
private void SelectionOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { CreateGroupCommand.RaiseCanExecuteChanged(); AddToGroupCommand.RaiseCanExecuteChanged(); UngroupCommand.RaiseCanExecuteChanged(); }
public async Task <IActionResult> Create([FromBody] CreateGroupCommand createGroupCommand) => await ExecuteCommand(createGroupCommand);