/// <summary> /// Puts the service location channel by source. /// </summary> /// <param name="sourceId">The source identifier.</param> /// <param name="request">The request.</param> /// <returns></returns> protected IActionResult PutServiceLocationChannelBySource(string sourceId, IVmOpenApiServiceLocationChannelInVersionBase request) { if (request == null) { ModelState.AddModelError("RequestIsNull", CoreMessages.OpenApi.RequestIsNull); return(new BadRequestObjectResult(ModelState)); } var vmBase = request.VersionBase() as VmOpenApiServiceLocationChannelInVersionBase; var validator = new ServiceLocationChannelValidator(vmBase, commonService, codeService, serviceService); return(PutServiceChannel(vmBase, validator, "Service location", sourceId: sourceId)); }
/// <summary> /// Posts the service location channel. /// </summary> /// <param name="request">The request.</param> /// <returns></returns> protected IActionResult PostServiceLocationChannel(IVmOpenApiServiceLocationChannelInVersionBase request) { if (request == null) { ModelState.AddModelError("RequestIsNull", CoreMessages.OpenApi.RequestIsNull); return(new BadRequestObjectResult(ModelState)); } // Validate the items if (!ModelState.IsValid) { return(new BadRequestObjectResult(ModelState)); } var vmBase = request.VersionBase() as VmOpenApiServiceLocationChannelInVersionBase; var validator = new ServiceLocationChannelValidator(vmBase, commonService, codeService, serviceService); return(PostServiceChannel(vmBase, validator)); }