public IActionResult AddLocation([FromBody] LocationDto locationDto) { EnsureArg.IsNotNull(locationDto); var command = new AddLocationCommand(locationDto); CommandDispatcher.Execute(command); return(NoContent()); }
public async Task <APIResult> AddLocation([FromBody] AddLocationCommand command) { var rs = await mediator.Send(command); return(new APIResult() { Result = rs }); }
public void AddLocationCommandTest() { location = EntityFactory.CreateLocation(1, "Venezolania", "cagua"); AddLocationCommand command = CommandFactory.createAddLocationCommand(location); command.Execute(); LOCATION_ID = command.GetResult(); Assert.NotNull(LOCATION_ID); }
public Task Add(AddLocationCommand command) { if (command is null) { _context.DeleteState(); } Name = command.Name; Longitude = command.Longitude; Latitude = command.Latitude; return(Task.CompletedTask); }
public void Init() { Location location = new Location(); location = EntityFactory.CreateLocation(1, "Venezolaniooo", "caguooa"); AddLocationCommand command = CommandFactory.createAddLocationCommand(location); command.Execute(); LOCATION_ID = command.GetResult(); Assert.NotNull(LOCATION_ID); }
public IActionResult AddLocation([FromBody] AddLocationCommand command) { return(Created(Request.Path.Value, _mediator.Send(command))); }