Beispiel #1
0
        public async Task <bool> CreateMotherboardPart(MotherboardServiceModel motherboardServiceModel)
        {
            Motherboard motherboardEntity = motherboardServiceModel.To <Motherboard>();

            motherboardEntity.Id = Guid.NewGuid().ToString();

            bool result = await this.pCCDbContext.AddAsync(motherboardEntity) != null;

            await this.pCCDbContext.SaveChangesAsync();

            return(result);
        }
Beispiel #2
0
        public async Task <IActionResult> CreateMotherboard(CreateMotherboardBindingModel createMotherboardBindingModel)
        {
            MotherboardServiceModel serviceModel = createMotherboardBindingModel.To <MotherboardServiceModel>();

            string url = await this.cloudinaryService.UploadImage(createMotherboardBindingModel.FileUpload);

            serviceModel.ImageUrl = url;

            bool result = await this.partsService.CreateMotherboardPart(serviceModel);

            return(Redirect("/"));
        }