public async Task <bool> PostNewMaterial(CourceMaterialApiModel.Request request)
        {
            CourceMaterial result = new CourceMaterial
            {
                courceMaterialId          = new Guid(),
                courceMaterialTitle       = request.courceMaterialTitle,
                printingShopId            = new Guid(request.printingShopId),
                courceMaterialDescreption = request.courceMaterialDescreption,
                courceMaterialPrice       = request.courceMaterialPrice,
                SubjectId   = new Guid(request.SubjectId),
                isAvailable = request.isAvailable
            };
            await applicationDbContext.courceMaterials.AddAsync(result);

            await applicationDbContext.SaveChangesAsync();

            return(true);
        }
Пример #2
0
 public async Task <bool> Post(CourceMaterialApiModel.Request request)
 {
     return(await _printingShops.PostNewMaterial(request));
 }