public async Task <IActionResult> Get(Guid?id) { var serviceModel = new GetSellerModel { Id = id, Language = CultureInfo.CurrentCulture.Name }; var validator = new GetSellerModelValidator(); var validationResult = await validator.ValidateAsync(serviceModel); if (validationResult.IsValid) { var seller = await this.organisationService.GetAsync(serviceModel); if (seller != null) { var response = new OrganisationResponseModel { Id = seller.Id, Name = seller.Name, Description = seller.Description, Files = seller.Files, Images = seller.Images, Videos = seller.Videos }; return(this.StatusCode((int)HttpStatusCode.OK, response)); } else { return(this.StatusCode((int)HttpStatusCode.NotFound)); } } return(this.StatusCode((int)HttpStatusCode.UnprocessableEntity)); }
public async Task <OrganisationServiceModel> GetAsync(GetSellerModel serviceModel) { var organisation = await this.identityContext.Organisations.FirstOrDefaultAsync(x => x.Id == serviceModel.Id && x.IsSeller && x.IsActive); return(await this.GetOrganisationAsync(organisation, serviceModel.Language)); }