コード例 #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);
        }
コード例 #2
0
        public async Task <IActionResult> AddService([FromBody] ServiAddRequest request)
        {
            Paslaugos addRequest = _serviService.BuildServicesAddRequest(request);

            return(Ok(addRequest));
        }