public BaseRepository() { SetConnectionString(); _orm = new SugarORM(_connectionString); _sugarClient = _orm.GetSqlClient <SqlSugarClient>(); }
/// <summary> /// Atualiza os dados to tipo <see cref="IORM{T}"/> que e passado no parâmetro /// </summary> /// <param name="item">objeto de classe que implementa e interface <see cref="IORM{T}"/></param> /// <returns>retorna um valor numérico indicando o resultado da operação</returns> public int Update(IORM <T> item) { return(ConnectionException <int> .AsyncCheck(() => { using (var connection = OpenDB()) { connection.Open(); DataBaseLog?.Invoke(this, new ConnectionEventArgs <T>($"atualização de dados: {item.GetThis()}")); if (UpdateString == null) { UpdateString = item.GetThis().QueryUpdate(); } return connection.Execute(UpdateString, item); } })); }
/// <summary> /// Adiciona um elemento do tipo <see cref="IORM{T}"/> no banco de dados /// </summary> /// <param name="item">objeto de classe que implementa e interface <see cref="IORM{T}"/></param> /// <returns>retorna um valor numérico indicando o resultado da operação</returns> public int?Add(IORM <T> item) { return(ConnectionException <int> .AsyncCheck(() => { using (var connection = OpenDB()) { connection.Open(); DataBaseLog?.Invoke(this, new ConnectionEventArgs <T>($"inserção do registro: {item.GetThis()}")); if (AddString == null) { AddString = item.GetThis().QueryAdd(); } return connection.Execute(AddString, item); } })); }
public CustomersController(IORM orm, IMapper mapper) { _orm = orm ?? throw new ArgumentNullException(nameof(orm)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public ConfigurationsController(IConfiguration configuration) { string connectionString = configuration["ConnectionString"]; _orm = new SugarORM(connectionString); }
public Repository(IORM <T> orm) { _ORM = orm; }
public OrderItemRepository(IORM <OrderItem> orm) : base(orm) { }
public ExchangeRepository(IORM <Exchange> orm) : base(orm) { }
public SqlServerRepository(IORM iSalesAppORM) { _iSalesAppORM = iSalesAppORM; }
private TestResult GetTestResultsByTeam(IORM ormObj, int teamID) { return(ormObj.GetTeamMemberByTeam(teamID)); }
public AssetRepository(IORM <Asset> orm) : base(orm) { }
public OrderRepository(IORM <Order> orm, IOrderItemRepository orderItemRepository) : base(orm) { _orderItemRepository = orderItemRepository; }
private TestResult GetTestResultsByProject(IORM ormObj, int projectID) { return(ormObj.GetTeamMemberByProject(projectID)); }
public ORM(IORM <ET> _orm) { orm = _orm; }
public BaseRepository() { SetConnectionString(); _orm = new SugarORM(_connectionString); }
public void TextFixtureSetup() { Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); CONNECTION_STRING = ConfigurationManager.ConnectionStrings[CONFIGURATION_CONNECTION_STRING].ConnectionString; _iORM = new MassiveAdapter(new SqlConnection(CONNECTION_STRING)); }
private TestResult GetTestResultsByMember(IORM ormObj, int teamMemberID) { return(ormObj.GetTeamMemberByID(teamMemberID)); }