Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gtechsltn/2025

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 

Repository files navigation

Dealing with missing closing tag of A tag in HTML file

CSharpConsoleApp.CommandLineApp ~ Console App (C#)

Console App (VB.NET) Project File (.csproj)

<PropertyGroup>
    <LangVersion>latest</LangVersion>
</PropertyGroup>

Console App (C#) Project File (.csproj)

<PropertyGroup>
    <LangVersion>preview</LangVersion>
</PropertyGroup>

Simplest way to ... Fully complete .NET 8 Minimal API template

Carrot Search FoamTree

  • Carrot Search FoamTree

Vis.js Graph3d

  • Vis.js Graph3d

Regular Expression (regex): CleanTemplateJson + Unit Testing

  • Regular Expression (regex) that matches any object instantiation starting with Ext...
    • Remove "new Ext.data.SimpleStore({...})" + Kepp "{...}" only
    • Remove "new Ext.data.Store({...})" + Kepp "{...}" only
    • ...
    • Remove "new Ext.Window({...})" + Kepp "{...}" only
  • ConfigHelper.CleanTemplateJson method that remove 31 ExtJS classes
  • Unit Tests with MSTest
    • Using DataRow with 31 test cases in 1 method
  • DbSchemaGenerator
  • DbSchemaExtractor

Vis.js Timeline

Tech Notes on 2025

Tôi muốn chỉ tải về một thư mục của GitHub thì làm như thế nào?

image
D:\gtechsltn>mkdir my-project

D:\gtechsltn>cd my-project

D:\gtechsltn\my-project>git init
Initialized empty Git repository in D:/gtechsltn/my-project/.git/

D:\gtechsltn\my-project>git sparse-checkout init --cone

D:\gtechsltn\my-project>git remote add origin https://github.com/launchdarkly/dotnet-core.git

D:\gtechsltn\my-project>git sparse-checkout set pkgs/sdk/server/src

D:\gtechsltn\my-project>git pull origin main
remote: Enumerating objects: 12769, done.
remote: Counting objects: 100% (1389/1389), done.
remote: Compressing objects: 100% (546/546), done.
Receiving objects: 100% (12769/12769), 3.37 MiB | 9.32 MiB/s, done.

Resolving deltas: 100% (8347/8347), done.
From https://github.com/launchdarkly/dotnet-core
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main

D:\gtechsltn\my-project>

Integrating TypeScript and jQuery

Hangfire

Updated on 2025-09-22

namespace Data.Repository
{
    public class UnitOfWork : IUnitOfWork
    {
        public IAccountRepository AccountRepository { get; set; }

        private WebBaseEntityContext _dbEntity;
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly IServiceProvider _serviceProvider;
        private readonly ConfigOptions _configOptions;

        public UnitOfWork(
            ConfigOptions configOptions,
            IHttpContextAccessor httpContextAccessor,
            IServiceProvider serviceProvider)
        {
            _configOptions = configOptions;
            _httpContextAccessor = httpContextAccessor;
            _serviceProvider = serviceProvider;
        }

        public string GetDatabaseName()
        {
            _dbEntity = _serviceProvider.GetRequiredService<WebBaseEntityContext>();

            var timeoutInSeconds = int.Parse(_configOptions.DatabaseTimeoutInSeconds);
            _dbEntity.Database.SetCommandTimeout(timeoutInSeconds);

            return _dbEntity.Database.GetDbConnection().Database;
        }
        ...
    }
}

RepoDb.SqlServer => Passing of Parameters

  • IDbDataParameter
  • Anonymous Types
  • ExpandoObject
  • Dictionary<string, object>
  • QueryField
  • QueryGroup

Updated on 2025-09-18

Chuẩn hóa tài liệu .md

https://github.com/gtechsltn/FileReplacer

So sánh đầu ra của 2 lần chạy ở 2 branch (master và hotfix/SG)

https://github.com/gtechsltn/FolderCompare

Tạo tệp đầu vào cho Data Export tool (xóa log, xóa bagit, chạy script reset db, tạo tệp input.csv, sửa connection string ở D:\ThirdSight\ThirdSight.DataMigration1\TSDataExport.exe.config)

https://github.com/gtechsltn/CsvGenerator

Tìm lỗi nếu có trên toàn bộ tệp log ở thư mục D:\ThirdSight\logs\ThirdSight.DataMigration1

https://github.com/gtechsltn/SearchText

Tech Notes on 2025

.NET Framework 4.8

Step 1: SQL Server – Define Table Type

CREATE TYPE dbo.TVP_Workspace AS TABLE
(
    WkSpcID BIGINT,
    MetaJson NVARCHAR(MAX)
);

Step 2: SQL Server – Stored Procedure

CREATE PROCEDURE dbo.InsertMetaWorkspaces
    @Workspaces dbo.TVP_Workspace READONLY
AS
BEGIN
    INSERT INTO meta_workspaces (WkSpcID, meta_json)
    SELECT WkSpcID, MetaJson FROM @Workspaces;
END

Step 3: C# – Create DataTable for TVP

private static DataTable CreateWorkspaceTvp(IEnumerable<MetaWorkspace> workspaces)
{
    var table = new DataTable();
    table.Columns.Add("WkSpcID", typeof(long));
    table.Columns.Add("MetaJson", typeof(string));

    foreach (var ws in workspaces)
    {
        table.Rows.Add(ws.WkSpcID, ws.MetaJson);
    }

    return table;
}

Step 4: Dapper – Call Stored Procedure with CommandDefinition

using (var connection = new SqlConnection(connectionString))
{
    var workspaces = new List<MetaWorkspace>
    {
        new MetaWorkspace { WkSpcID = 1, MetaJson = "{ \"a\": 1 }" },
        new MetaWorkspace { WkSpcID = 2, MetaJson = "{ \"b\": 2 }" }
    };

    var tableParam = new SqlParameter("@Workspaces", CreateWorkspaceTvp(workspaces))
    {
        SqlDbType = SqlDbType.Structured,
        TypeName = "dbo.TVP_Workspace"
    };

    var command = new CommandDefinition(
        commandText: "dbo.InsertMetaWorkspaces",
        parameters: new { }, // we'll inject via DynamicParameters
        commandType: CommandType.StoredProcedure,
        commandTimeout: 60
    );

    var dynamicParams = new DynamicParameters();
    dynamicParams.Add("@Workspaces", tableParam.Value, DbType.Object, ParameterDirection.Input);

    // You can also pass SqlParameter directly via ADO.NET
    connection.Execute(command.CommandText, dynamicParams, commandType: command.CommandType);
}

Backend Development:

Automation (Tự động hóa)

Referecnes

Solution for the coursera course Service-Oriented Architecture offered by University of Alberta
https://github.com/gtechsltn/Service-Oriented-Architecture

SOA module of a larger web portal. This module pertains to data warehousing and analysis, logging and advertisement services.
https://github.com/markus-lamm/hv-sos100-dataservice
https://github.com/gtechsltn/hv-sos100-dataservice

This project contains prototype for SQL IDE developed as my course project for 3rd year of studies in kpi. Technologies: C#, WPF, PostgreSQL
https://github.com/mynameiszp/sql-ide-project/tree/main
https://github.com/gtechsltn/sql-ide-project

✅ MVC 5, Bootstrap, Web API 2, JQuery, Ajax, EF6, DDD
https://github.com/piotr-mamenas/performance-app
https://github.com/gtechsltn/performance-app

WEB API in .Net 7 with JWT Auth and EF Core. Ths is a Web API project for Authentication and Authorization. It used ASP.Net Core 7 using EF Core with MS SQL DB.
https://github.com/ahsan-javied/Web-API-Dot-Net-Core-7
https://github.com/gtechsltn/Web-API-Dot-Net-Core-7

Northwind + AgularJS
https://github.com/alisuleymantopuz/soa-arch
https://github.com/gtechsltn/soa-arch

Northwind Backend (.NET Core 3.1)
This service oriented architecture project was developed on .NET Core.
https://github.com/gtechsltn/NorthwindBackend

Document Management System

https://github.com/diaakhateeb/FRISS_DocumentManagementSystem
https://github.com/gtechsltn/FRISS_DocumentManagementSystem

ASP.NET WCF, MySQL

A SOAP-based loan management system built with C# and ASP.NET WCF, designed to streamline library operations with CRUD functionalities for loans, user-friendly integration, and scalable service-oriented architecture.

https://github.com/Yassinekrn/SOAP-Based-Loan-Management-WS
https://github.com/gtechsltn/SOAP-Based-Loan-Management-WS

Service-Oriented Architecture
https://github.com/KountourisPanagiotis/products-soa-app
https://github.com/gtechsltn/products-soa-app

ShowCase: QuestionController
https://github.com/cloudtoid/poem/blob/master/showcase/QnA/Controllers/QuestionController.cs

Mini e-shop MVC project (.NET 6)
https://github.com/ResadMemmedov0035/MiniEshopOnionDemo
https://github.com/gtechsltn/MiniEshopOnionDemo

Error Handlers
https://github.com/ResadMemmedov0035/MiniEshopOnionDemo/blob/master/MiniEshop.Web/Controllers/ErrorHandleController.cs

Background File Processing Service (.NET 8)
https://github.com/Voidcoolis/CvsProcessorAPI
https://github.com/gtechsltn/CvsProcessorAPI

This API simulates a real-world background file processing service. CSV files uploaded by authenticated users are queued and processed line by line using a background service. This architecture showcases common backend engineering patterns.
https://github.com/gtechsltn/CvsProcessorAPI/blob/master/CvsProcessorAPI/Queue/InMemoryFileProcessingQueue.cs

Queue
System.Collections.Concurrent
ConcurrentQueue<string>
IFileProcessingQueue
Enqueue
Dequeue

ThirdSight-SLA-PreCheck (ThirdSight.SLA.PreCheck)

Connection String in EF Core

Case 01: (Encrypt=True, TrustServerCertificate=False)

Only if your SQL Server has a valid SSL/TLS certificate.

​Data Source=tcp:NPTDIFILEDB1P,1436;
Initial Catalog=Thirdsight;
Integrated Security=SSPI;
Encrypt=True;
TrustServerCertificate=False;
Pooling=True;
Connect Timeout=30;

Case 02: (Encrypt=False, TrustServerCertificate=False)

Only for testing, dev, or isolated on-prem networks.

​Data Source=tcp:NPTDIFILEDB1P,1436;
Initial Catalog=Thirdsight;
Integrated Security=SSPI;
Encrypt=False;
TrustServerCertificate=False;
Pooling=True;
Connect Timeout=30;

Quick decision flow

Scenario Recommended Connection String
Local/dev box Encrypt=False;
Internal test server (self-signed cert) Encrypt=True;TrustServerCertificate=True;
Production (CA-signed cert) Encrypt=True;TrustServerCertificate=False;

About

Tech Notes on 2025

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published