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

View File

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