using Infrastructure.Extensions; using OpenAuth.App.Interface; using OpenAuth.Repository; using OpenAuth.Repository.Core; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OpenAuth.App.Base { public class StringTreeApp : TreeApp where T : TreeEntity, new() where TDbContext : SugarUnitOfWork, new() { public StringTreeApp(ISugarUnitOfWork unitWork, ISimpleClient repository, IAuth auth) : base(unitWork, repository, auth) { } protected override string GetDefaultId() { return "0"; /* return ""; */// Define your default Id value for string type } protected override string GetDefaultCascadeId() { var max = base.Repository.AsSugarClient().Queryable().Where(a => a.ParentId == "0").Max(a => SqlFunc.ToInt32(a.CascadeId)); return (max+1).ToString(); // Define your default CascadeId value for string type } } }