Beispiel #1
0
        public async Task <CreateMedicalServiceRes> CreateMedicalService(CreateMedicalServiceReq request)
        {
            DynamicParameters parameters = new DynamicParameters();

            parameters.Add(name: "@MServiceName", request.MServiceName);
            parameters.Add(name: "@Price", request.Price);
            parameters.Add(name: "@IsActive", request.IsActive);
            parameters.Add(name: "@DepartmentId", request.DepartmentId);

            using var result = SqlMapper.QueryFirstOrDefaultAsync <CreateMedicalServiceRes>(
                      cnn: connection,
                      sql: "sp_CreateMedicalService",
                      param: parameters,
                      commandType: CommandType.StoredProcedure);
            try
            {
                return(await result);
            }
            catch (Exception)
            {
                return(new CreateMedicalServiceRes());
            }
        }
 public async Task <IActionResult> CreateMedicalService(CreateMedicalServiceReq request)
 {
     return(Ok(await _medicalServiceService.CreateMedicalService(request)));
 }
 public async Task <CreateMedicalServiceRes> CreateMedicalService(CreateMedicalServiceReq request)
 {
     return(await _medicalServiceRepository.CreateMedicalService(request));
 }