Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

common-utils

English | Русский

⚠️ Project Status: Archived & Legacy Reference
This repository is a personal R&D playground and is no longer actively maintained or developed. The code is preserved strictly as a historical technical reference for fluent ADO.NET wrappers, metadata extraction, and enterprise CRM/ERP utility extensions.

Idea

This library was created to solve the problem of code duplication and disparate object models when developing business applications. For example, I often had to create identical entities and services in different projects, which led to a loss of time and complicated support. It is worth noting that each project had its own repository, which complicated the integration between projects and the ability to change the object model.

As a result, it was decided to create a mono-repository, which included most of the previously created projects, as well as a common object model for representing data in the DB. This approach allows:

  • Avoid code duplication.
  • Ensure data consistency between projects.
  • Reduce development time by reusing ready-made components.
  • Simplify refactoring and dependency management.

Shared

List of the shared projects (reusable data models, services, and extensions):

  • CodeExtensions
  • DbOperations: unified operations with relational databases, simplifying the extraction and insertion of data from disparate sources.
  • Models
  • Models.Business: is an implementation of a shared object model for business entities used within the mono-repository.
  • Office: library for working with office document formats.
  • Office.Extensions: extension library for working with office document formats.
  • WpfExtensions: is a library of visual elements for WPF applications.

The library offers functionality for unified operations with relational databases, simplifying the extraction and insertion of data from disparate sources. This functionality may be necessary in applications such as sqlviewer.

An example of executing the CREATE TABLE IF NOT EXISTS command and a given SQL query using the common IVelocipedeDbConnection interface is shown below:

using IVelocipedeDbConnection dbConnection
    = VelocipedeDbConnectionFactory.InitializeDbConnection(databaseType);

dbConnection
    .SetConnectionString(connectionString)
    .OpenDb()
    .CreateDbIfNotExists(newDatabaseName)
    .SwitchDb(newDatabaseName)
    .ExecuteSqlCommand(sqlQuery, out DataTable dtResult)
    .CloseDb();

Metadata about the database to which an active connection is established, as well as about the tables in it, can be obtained as follows:

using IVelocipedeDbConnection dbConnection
    = VelocipedeDbConnectionFactory.InitializeDbConnection(databaseType, connectionString);

dbConnection
    .OpenDb()
    .GetAllData(tableName, out DataTable dtData)       // You can get result as DataTable,
    .GetAllData(tableName, out List<Table1> listData)  // or as List<T>.
    .GetColumnsOfTable(tableName, out List<VelocipedeColumnInfo> columnInfo)
    .GetForeignKeys(tableName, out List<VelocipedeForeignKeyInfo> foreignKeyInfo)
    .GetTriggers(tableName, out List<VelocipedeTriggerInfo> triggerInfo)
    .GetSqlDefinition(tableName, out string sqlDefinition)
    .CloseDb();

This library provides functionality for communicating with relational databases using ADO.NET and Dapper under the hood. Information on currently supported database types:

Projects

This project is a web application on ASP.NET MVC, designed for company management (organizational structure, employee information, and automation of key HR processes).

Ubp.HomePage

Visualization of the hierarchical structure of the company: organizations, departments, teams, positions:

Ubp.Organizations

Employee information management:

Ubp.Employees

Planned improvements:

  • Absence management: A system for recording vacations, sick leaves, and other types of employee absences.
  • Payroll calculation: Automatic calculation of wages based on hours worked and other factors.
  • Internal Documentation: A tool for storing and managing internal company documents such as policies, procedures, instructions.
  • Knowledge Base: Creating and maintaining a knowledge base for sharing experiences and information between employees.

About

[Archived / Legacy] A centralized collection of reusable data models and extensions originally designed to prevent code duplication.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages