public async Task InsertShortenUrl(ShortenUrlDTO shortenUrlDTO) { var parameters = new Dictionary <string, object> { { "Code", shortenUrlDTO.Code }, { "OriginalUrl", shortenUrlDTO.Url } }; await _sqlDataAccess.Execute("uspInsertShortUrl", parameters); }
public DataRow GetMasterSettings() { try { var query = string.Format(queries["SelectMasterSettings"], MasterId); var sqlCommand = sqlDataAccess.GetCommand(query); var result = sqlDataAccess.Execute(sqlCommand); return(result.Rows[0]); } catch (Exception exception) { FileLogger.Log($"TDClient Master settings could not be loaded successfully from database as : {exception.Message}"); throw; } }
public async Task <int> Save(EmployeeModel1 model) { try { return(await sqlDataAccess.Execute("UpdEmployee1 @EmployeeId,@EmployeeName,@Salary,@Role", model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <int> Save(EmployeeModel model) { try { //return await Connection.ExecuteAsync("UpdEmployee @EmployeeId, @EmployeeName, @Salary, @Role", model,Transaction); return(await sqlDataAccess.Execute("UpdEmployee @EmployeeId,@EmployeeName,@Salary,@Role", model)); } catch (Exception e) { throw new Exception(e.Message); } //return await sqlDataAccess.Execute("UpdEmployee @EmployeeId,@EmployeeName,@Salary,@Role", model); }
public DataRow GetMasterSettings() { try { var query = string.Format(queries["SelectMasterSettings"], MasterId); var sqlCommand = sqlDataAccess.GetCommand(query); var result = sqlDataAccess.Execute(sqlCommand); return(result.Rows[0]); } catch (Exception exception) { Console.WriteLine(exception); throw; } }