Add db connect support

This commit is contained in:
Ling 2024-10-09 17:10:05 +08:00
parent 22fbb522d2
commit c3c740ed78
2 changed files with 6 additions and 3 deletions

View File

@ -1,15 +1,17 @@
using LFlow.Base.Interfaces;
using SqlSugar;
namespace LFlow.Home.Models.DataModels;
[SugarTable("T_B_HOME")]
public class HomeModel : IDataModel
{
/// <summary>
/// ID
/// ID - GUID
/// </summary>
[SugarColumn(ColumnName = "ID", IsPrimaryKey = true)]
public string? Id { get; set; }
public override string ToString()
{
return $"HomeModel {Id}";

View File

@ -3,10 +3,11 @@ using LFlow.Base.Interfaces;
// using LFlow.Interfaces;
using LFlow.Home.Models.DataModels;
using SqlSugar;
namespace LFlow.Home.Repositorys;
public class HomeRepo : IRepo<HomeModel, string>
public class HomeRepo(ISqlSugarClient db) : IRepo<HomeModel, string>
{
public HomeModel Delete(string id)
{