public GroupsResource( IGenericJsonPagedQuery genericJsonPagedQuery, ICreateGroupCommand createGroupCommand) { this.genericJsonPagedQuery = genericJsonPagedQuery; this.createGroupCommand = createGroupCommand; }
public IActionResult Post( [FromBody] GroupDto dto, [FromServices] ICreateGroupCommand command) { _executor.ExecuteCommand(command, dto); return(NoContent()); }
public IActionResult Post([FromBody] CreateGroupModel newGroup, [FromServices] ICreateGroupCommand createGroupCommand) { if (ModelState.IsValid) { var storedGroup = createGroupCommand.Execute(newGroup); return(Created(Request.Path.Value + "/" + storedGroup.Id, storedGroup)); } else { return(BadRequest("Something went wrong")); } }
public GroupController( IGenericJsonPagedQuery genericJsonPagedQuery, IEntityById entityById, ICreateGroupCommand createGroupCommand, IUpdateGroupCommand updateGroupCommand, IDeleteGroupCommand deleteGroupCommand ) { this.genericJsonPagedQuery = genericJsonPagedQuery; this.entityById = entityById; this.createGroupCommand = createGroupCommand; this.updateGroupCommand = updateGroupCommand; this.deleteGroupCommand = deleteGroupCommand; }
public void Post([FromBody] GroupDto dto, [FromServices] ICreateGroupCommand command) { executor.ExecuteCommand(command, dto); }