public virtual async Task <CreateResponse <ApiCountryRequirementServerResponseModel> > Create( ApiCountryRequirementServerRequestModel model) { CreateResponse <ApiCountryRequirementServerResponseModel> response = ValidationResponseFactory <ApiCountryRequirementServerResponseModel> .CreateResponse(await this.CountryRequirementModelValidator.ValidateCreateAsync(model)); if (response.Success) { CountryRequirement record = this.DalCountryRequirementMapper.MapModelToEntity(default(int), model); record = await this.CountryRequirementRepository.Create(record); response.SetRecord(this.DalCountryRequirementMapper.MapEntityToModel(record)); await this.mediator.Publish(new CountryRequirementCreatedNotification(response.Record)); } return(response); }
public virtual async Task <CreateResponse <ApiHandlerPipelineStepServerResponseModel> > Create( ApiHandlerPipelineStepServerRequestModel model) { CreateResponse <ApiHandlerPipelineStepServerResponseModel> response = ValidationResponseFactory <ApiHandlerPipelineStepServerResponseModel> .CreateResponse(await this.HandlerPipelineStepModelValidator.ValidateCreateAsync(model)); if (response.Success) { HandlerPipelineStep record = this.DalHandlerPipelineStepMapper.MapModelToEntity(default(int), model); record = await this.HandlerPipelineStepRepository.Create(record); response.SetRecord(this.DalHandlerPipelineStepMapper.MapEntityToModel(record)); await this.mediator.Publish(new HandlerPipelineStepCreatedNotification(response.Record)); } return(response); }