Example #1
0
        public Paslaugos BuildServicesAddRequest(ServiAddRequest request)
        {
            var service = new Paslaugos
            {
                Rizika      = request.Rizika,
                Pavadinimas = request.Pavadinimas,
                Kaina       = request.Kaina,
                Aprasymas   = request.Aprasymas,
                Narkoze     = request.Narkoze,
                Trukme      = request.Trukme,
                FkDarbuotojaiidDarbuotojai = request.FkDarbuotojaiidDarbuotojai
            };

            _context.Paslaugos.Add(service);
            _context.SaveChanges();
            return(service);
        }
        public async Task <IActionResult> AddService([FromBody] ServiAddRequest request)
        {
            Paslaugos addRequest = _serviService.BuildServicesAddRequest(request);

            return(Ok(addRequest));
        }