Beispiel #1
0
        public async Task <bool> CreateGPUPart(GPUServiceModel gPUServiceModel)
        {
            GPU gPUEntity = gPUServiceModel.To <GPU>();

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

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

            await this.pCCDbContext.SaveChangesAsync();

            return(result);
        }
Beispiel #2
0
        public async Task <IActionResult> CreateGPU(CreateGPUBindingModel createGPUBindingModel)
        {
            GPUServiceModel serviceModel = createGPUBindingModel.To <GPUServiceModel>();

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

            serviceModel.ImageUrl = url;

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

            return(Redirect("/"));
        }