├── .editorconfig ├── .gitattributes ├── .gitignore ├── Demo ├── BlazorApp1 │ ├── App.razor │ ├── BlazorApp1.csproj │ ├── Data │ │ ├── CagetoryCts.cs │ │ ├── WeatherForecast.cs │ │ └── WeatherForecastService.cs │ ├── DemoLookupService.cs │ ├── Model │ │ ├── AspNetRoleClaims.cs │ │ ├── AspNetRoles.cs │ │ ├── AspNetUserClaims.cs │ │ ├── AspNetUserLogins.cs │ │ ├── AspNetUserRoles.cs │ │ ├── AspNetUserTokens.cs │ │ ├── AspNetUsers.cs │ │ ├── DeviceCodes.cs │ │ ├── Keys.cs │ │ ├── PersistedGrants.cs │ │ ├── WebAppIdentityUser.cs │ │ ├── ___EFMigrationsHistory.cs │ │ ├── __razor.cshtml.txt │ │ └── __重新生成.bat │ ├── Pages │ │ ├── Counter.razor │ │ ├── DemoTableEditTemplate.razor │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── FetchData.razor │ │ ├── FetchDataCagetory.razor │ │ ├── FetchDataCagetory2.razor │ │ ├── FetchDataCagetory3.razor │ │ ├── Index.razor │ │ ├── Index.razor.cs │ │ ├── TableCustomComponent.razor │ │ ├── TableCustomComponent.razor.cs │ │ ├── TableDetailsDemo.razor │ │ ├── TableDetailsDemo.razor.cs │ │ ├── TableTotalDemo.razor │ │ ├── TableTotalDemo.razor.cs │ │ └── _Host.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── MainLayout.razor.css │ │ ├── NavMenu.razor │ │ ├── NavMenu.razor.css │ │ └── SurveyPrompt.razor │ ├── _Imports.razor │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── demo.db │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ │ ├── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.svg │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ └── site.css │ │ └── favicon.png └── ConsoleApp1 │ ├── ConsoleApp1.csproj │ ├── Model │ ├── AspNetRoleClaims.cs │ ├── AspNetRoles.cs │ ├── AspNetUserClaims.cs │ ├── AspNetUserLogins.cs │ ├── AspNetUserRoles.cs │ ├── AspNetUserTokens.cs │ ├── AspNetUsers.cs │ ├── DeviceCodes.cs │ ├── Keys.cs │ ├── PersistedGrants.cs │ ├── WebAppIdentityUser.cs │ ├── ___EFMigrationsHistory.cs │ ├── __razor.cshtml.txt │ └── __重新生成.bat │ ├── Program.cs │ └── Properties │ └── launchSettings.json ├── Densen.Freesql.SC.sln ├── Densen.Freesql.sln ├── LICENSE.txt ├── README.md ├── logo.png ├── src ├── BootstrapBlazor.DataAcces.FreeSql │ ├── Components │ │ ├── CustomerFilter.razor │ │ ├── EnumTableDetailRowType.cs │ │ ├── FloatPanel.razor │ │ ├── TableAmeBase.cs │ │ ├── TableAmePro.razor │ │ ├── TableAmePro.razor.cs │ │ ├── TableAmeProBase.cs │ │ ├── TableAmeProDetails.cs │ │ ├── TableAmeProDetailsIII.cs │ │ └── TablePollo.cs │ ├── DataTableExpression.cs │ ├── Densen.Extensions.Freesql.BootstrapBlazor.csproj │ ├── Densen.Extensions.Freesql.BootstrapBlazor.xml │ ├── Directory.Build.props │ ├── Extensions │ │ ├── FreeSqlExtensions.cs │ │ ├── FreeSqlServiceCollectionExtensions.cs │ │ └── LambadaExpressionExtensions.cs │ ├── FreeSqlUtil.cs │ ├── README.md │ ├── Services │ │ ├── FreeSqlDataService.cs │ │ └── MemoryDataService.cs │ ├── TableImgField.cs │ └── _Imports.razor ├── BootstrapBlazor.Table.Freesql │ ├── BootstrapBlazor.Table.Freesql.csproj │ ├── Component │ │ ├── TableAdv.razor │ │ └── TableAdv.razor.cs │ ├── Directory.Build.props │ ├── FreeSqlServiceCollectionExtensions.cs │ ├── README.md │ └── _Imports.razor ├── BootstrapBlazor.Table.ImportExportsMiniService │ ├── BootstrapBlazor.Table.ImportExportsMiniService.csproj │ ├── Directory.Build.props │ ├── Interface │ │ └── IImportExport.cs │ ├── README.md │ └── Service │ │ └── ImportExportsMiniService.cs ├── BootstrapBlazor.Table.ImportExportsService │ ├── BootstrapBlazor.Table.ImportExportsService.csproj │ ├── Directory.Build.props │ ├── README.md │ └── Service │ │ └── ImportExportsService.cs ├── Densen.BootstrapBlazor.Abtracts │ ├── Attributes │ │ ├── AutoGenerateBaseAttribute.cs │ │ ├── AutoGenerateClassAttribute.cs │ │ └── AutoGenerateColumnAttribute.cs │ ├── Components │ │ └── BootstrapInput.cs │ ├── Densen.BootstrapBlazor.Abtracts.csproj │ ├── Enums │ │ ├── Alignment.cs │ │ ├── BreakPoint.cs │ │ └── SortOrder.cs │ ├── Interface │ │ ├── FakeCodeAnalysis.cs │ │ ├── FakeRenderFragment.cs │ │ ├── FilterAction.cs │ │ ├── FilterKeyValueAction.cs │ │ ├── FilterLogic.cs │ │ ├── IEditorItem.cs │ │ ├── IFilter.cs │ │ ├── IFilterAction.cs │ │ ├── ITableColumn.cs │ │ ├── IValidator.cs │ │ ├── SearchFilterAction.cs │ │ ├── SelectedItem.cs │ │ └── TableCellArgs.cs │ ├── README.md │ └── Utils │ │ └── Utility.cs ├── Densen.DataAcces.FreeSql │ ├── Densen.DataAcces.FreeSql.csproj │ ├── FreeSqlServiceOptions.cs │ ├── FsqlCloud.cs │ └── README.md ├── Directory.Build.props └── keys │ └── Longbow.Utility.snk └── test └── ConsoleAppTest ├── ConsoleMagicodes.IE.Test.csproj ├── ConsoleMagicodes.IE.Test.sln ├── ConsoleMagicodes.IE.Test.xml ├── IE.cs ├── IE2.cs └── Program.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | Not found 9 | 10 |

Sorry, there's nothing at this address.

11 |
12 |
13 |
14 |
-------------------------------------------------------------------------------- /Demo/BlazorApp1/BlazorApp1.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0;net9.0; 5 | enable 6 | enable 7 | latest 8 | Debug;Release;DebugSC 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Data/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | //using Magicodes.ExporterAndImporter.Excel; 10 | //using OfficeOpenXml.Table; 11 | using System.ComponentModel; 12 | 13 | namespace BlazorApp1.Data; 14 | 15 | //[ExcelImporter(IsLabelingError = true)] 16 | //[ExcelExporter(Name = "导入商品中间表", TableStyle = TableStyles.Light10, AutoFitAllColumn = true)] 17 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true)] 18 | public class WeatherForecast 19 | { 20 | [Column(IsIdentity = true)] 21 | [DisplayName("序号")] 22 | public int ID { get; set; } 23 | 24 | [DisplayName("日期")] 25 | public DateTime Date { get; set; } 26 | 27 | public int TemperatureC { get; set; } 28 | 29 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 30 | 31 | public string? Summary { get; set; } 32 | 33 | //[DisplayName("备注")] 34 | //public string? Remarks { get; set; } 35 | 36 | [DisplayName("备注表")] 37 | [Navigate("ID")] 38 | public virtual Remarks? Remark { get; set; } 39 | //在 本实体 查找 ID 属性,与 Remarks 主键 关联 40 | } 41 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Data/WeatherForecastService.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | namespace BlazorApp1.Data; 8 | 9 | public class WeatherForecastService 10 | { 11 | private static readonly string[] Summaries = new[] 12 | { 13 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 14 | }; 15 | 16 | public Task GetForecastAsync(DateTime startDate) 17 | { 18 | return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast 19 | { 20 | Date = startDate.AddDays(index), 21 | TemperatureC = Random.Shared.Next(-20, 55), 22 | Summary = Summaries[Random.Shared.Next(Summaries.Length)], 23 | Remark = new Remarks { Remark = "Remark" + index } 24 | }).ToArray()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/DemoLookupService.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using Densen.Models.ids; 9 | using System.Runtime.Caching; 10 | 11 | namespace Microsoft.Extensions.DependencyInjection; 12 | 13 | /// 14 | /// 演示网站示例数据注入服务实现类 15 | /// 16 | internal class DemoLookupService : ILookupService 17 | { 18 | private IServiceProvider Provider { get; } 19 | 20 | private IFreeSql fsql { get; set; } 21 | 22 | private string? LookupKey { get; set; } 23 | 24 | private ObjectCache cache = MemoryCache.Default; 25 | 26 | private CacheItemPolicy cacheItemPolicy = new CacheItemPolicy 27 | { 28 | AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(60.0), 29 | }; 30 | 31 | public DemoLookupService(IServiceProvider provider, IFreeSql fsql) 32 | { 33 | Provider = provider; 34 | this.fsql = fsql; 35 | } 36 | 37 | public IEnumerable? GetItemsByKey(string? key) 38 | { 39 | IEnumerable? items = null; 40 | var cacheKey = $"{key}_{LookupKey}"; 41 | if (key!=null && cache.Get(cacheKey) != null) 42 | { 43 | System.Console.WriteLine($"* 从缓存中获取 {key} - {LookupKey}"); 44 | return cache.Get(cacheKey) as IEnumerable; 45 | } 46 | else 47 | { 48 | if (key == "Provideres") 49 | { 50 | items = new List() 51 | { 52 | new() { Value = "True", Text = "真真" }, 53 | new() { Value = "False", Text = "假假" }, 54 | new() { Value = "Google", Text = "谷歌" }, 55 | new() { Value = "Google2", Text = "谷歌" }, 56 | new() { Value = "Google3", Text = "谷歌" }, 57 | new() { Value = "Google4", Text = "谷歌" }, 58 | new() { Value = "Google5", Text = "谷歌" }, 59 | new() { Value = "Google6", Text = "谷歌" }, 60 | new() { Value = "Google7", Text = "谷歌" }, 61 | new() { Value = "Google8", Text = "谷歌" }, 62 | new() { Value = "Google9", Text = "谷歌" }, 63 | new() { Value = "Googlea", Text = "谷歌" }, 64 | new() { Value = "Googleb", Text = "谷歌" }, 65 | new() { Value = "Googlec", Text = "谷歌" }, 66 | new() { Value = "Googled", Text = "谷歌" }, 67 | new() { Value = "Googlee", Text = "谷歌" }, 68 | new() { Value = "Googlef", Text = "谷歌" }, 69 | new() { Value = "Googlei", Text = "谷歌" }, 70 | new() { Value = "Googlej", Text = "谷歌" }, 71 | new() { Value = "Googlek", Text = "谷歌" }, 72 | }; 73 | } 74 | else if (key == nameof(AspNetUsers.UserName)) 75 | { 76 | items = fsql.Select().Distinct().ToList(a => new SelectedItem() { Value = a.UserName, Text = a.UserName }); 77 | } 78 | else if (key == nameof(AspNetUserRoles.RoleId)) 79 | { 80 | items = fsql.Select() 81 | .WhereIf(LookupKey != null, a => a.UserId == LookupKey) 82 | .Distinct() 83 | .ToList(a => new SelectedItem() { Value = a.RoleId, Text = a.AspNetRoless.Name }); 84 | } 85 | else if (key != null && key.StartsWith("SetLookupKey:")) 86 | { 87 | //调用 hack 方式 LookupKeyService.GetItemsByKey($"SetLookupKey:{item.Id}"); 88 | // 设置当前查询条件, 用于后续查询 89 | LookupKey = key.Replace("SetLookupKey:", ""); 90 | } 91 | if (items != null) 92 | { 93 | cache.Add(cacheKey, items, cacheItemPolicy); 94 | System.Console.WriteLine($"* 添加缓存 {key} - {LookupKey}"); 95 | } 96 | return items; 97 | } 98 | } 99 | 100 | public IEnumerable? GetItemsByKey(string? key, object? data) 101 | { 102 | if (key != null && key == "SetLookupKey" && data?.ToString() != null) 103 | { 104 | //LookupKeyService.GetItemsByKey("SetLookupKey", item.Id); 105 | //设置当前查询条件, 用于后续查询 106 | LookupKey = data.ToString(); 107 | } 108 | return GetItemsByKey(key); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetRoleClaims.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 角色声明 17 | /// 18 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class AspNetRoleClaims 21 | { 22 | 23 | [AutoGenerateColumn(Visible = false, Order = 1, Width = 30, TextEllipsis = true)] 24 | [DisplayName("ID")] 25 | [JsonProperty, Column(IsPrimary = true, IsIdentity = true)] 26 | public int Id { get; set; } 27 | 28 | [DisplayName("角色ID")] 29 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 30 | public string RoleId { get; set; } 31 | 32 | [DisplayName("角色声明")] 33 | [JsonProperty, Column(StringLength = -2)] 34 | public string ClaimType { get; set; } 35 | 36 | [DisplayName("值")] 37 | [JsonProperty, Column(StringLength = -2)] 38 | public string ClaimValue { get; set; } 39 | 40 | [AutoGenerateColumn(Ignore = true)] 41 | [Navigate(nameof(RoleId))] 42 | public virtual AspNetRoles AspNetRoles { get; set; } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetRoles.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 角色定义 17 | /// 18 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class AspNetRoles 21 | { 22 | 23 | [AutoGenerateColumn(Visible = false, Order = 1, Width = 30, TextEllipsis = true)] 24 | [DisplayName("ID")] 25 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 26 | public string Id { get; set; } 27 | 28 | [DisplayName("角色")] 29 | [JsonProperty, Column(StringLength = -2)] 30 | public string Name { get; set; } 31 | 32 | [DisplayName("标准化名称")] 33 | [AutoGenerateColumn(Visible = false)] 34 | [JsonProperty, Column(StringLength = -2)] 35 | public string NormalizedName { get; set; } 36 | 37 | [DisplayName("并发票据")] 38 | [AutoGenerateColumn(Visible = false)] 39 | [JsonProperty, Column(StringLength = -2)] 40 | public string ConcurrencyStamp { get; set; } 41 | 42 | //导航属性 43 | [AutoGenerateColumn(Ignore = true)] 44 | [Navigate(nameof(AspNetUserRoles.RoleId))] 45 | [DisplayName("角色表")] 46 | public virtual List AspNetUserRoless { get; set; } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetUserClaims.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 用户声明 17 | /// 18 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class AspNetUserClaims 21 | { 22 | 23 | [AutoGenerateColumn(Visible = false, Order = 1, Width = 30, TextEllipsis = true)] 24 | [DisplayName("ID")] 25 | [JsonProperty, Column(IsPrimary = true, IsIdentity = true)] 26 | public int Id { get; set; } 27 | 28 | [DisplayName("用户ID")] 29 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 30 | public string UserId { get; set; } 31 | 32 | [DisplayName("声明类型")] 33 | [JsonProperty, Column(StringLength = -2)] 34 | public string ClaimType { get; set; } 35 | 36 | [DisplayName("值")] 37 | [JsonProperty, Column(StringLength = -2)] 38 | public string ClaimValue { get; set; } 39 | 40 | /// 41 | /// 用户 42 | /// 43 | [AutoGenerateColumn(Ignore = true)] 44 | [Navigate(nameof(UserId))] 45 | public virtual AspNetUsers AspNetUsers { get; set; } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetUserLogins.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 用户登录 17 | /// 18 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class AspNetUserLogins 21 | { 22 | 23 | [DisplayName("外联登录")] 24 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 25 | public string LoginProvider { get; set; } 26 | 27 | [AutoGenerateColumn(Visible = false, Width = 30, TextEllipsis = true)] 28 | [DisplayName("用户ID")] 29 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 30 | public string UserId { get; set; } 31 | 32 | [DisplayName("外联Key")] 33 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 34 | public string ProviderKey { get; set; } 35 | 36 | [DisplayName("外联名称")] 37 | [JsonProperty, Column(StringLength = -2)] 38 | public string ProviderDisplayName { get; set; } 39 | 40 | /// 41 | /// 用户 42 | /// 43 | [AutoGenerateColumn(Ignore = true)] 44 | [Navigate(nameof(UserId))] 45 | public virtual AspNetUsers AspNetUsers { get; set; } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetUserRoles.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 角色表 17 | /// 存储向哪些用户分配哪些角色 18 | /// 19 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 20 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 21 | public partial class AspNetUserRoles 22 | { 23 | 24 | [AutoGenerateColumn(Visible = false, Order = 2, TextEllipsis = true)] 25 | [DisplayName("用户ID")] 26 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 27 | public string UserId { get; set; } 28 | 29 | [JsonProperty, Column(IsIgnore = true)] 30 | [DisplayName("用户")] 31 | public string UserName { get => userName ?? (AspNetUserss?.UserName); set => userName = value; } 32 | 33 | private string userName; 34 | 35 | [AutoGenerateColumn( Order = 2, TextEllipsis = true,LookupServiceKey = nameof(RoleId), ShowSearchWhenSelect = false)] 36 | [DisplayName("角色ID")] 37 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 38 | public string RoleId { get; set; } 39 | 40 | [AutoGenerateColumn(Order = 1)] 41 | [JsonProperty, Column(IsIgnore = true)] 42 | [DisplayName("角色名称")] 43 | public string RoleName { get => roleName ?? (AspNetRoless?.Name); set => roleName = value; } 44 | 45 | private string roleName; 46 | 47 | [DisplayName("角色定义")] 48 | [AutoGenerateColumn(Ignore = true)] 49 | [Navigate(nameof(RoleId))] 50 | public virtual AspNetRoles AspNetRoless { get; set; } 51 | 52 | [DisplayName("用户表")] 53 | [AutoGenerateColumn(Ignore = true)] 54 | [Navigate(nameof(UserId))] 55 | public virtual AspNetUsers AspNetUserss { get; set; } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/AspNetUserTokens.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 用户令牌 17 | /// 18 | [AutoGenerateClass(Searchable = true, Filterable = true, Sortable = true, ShowTips = true)] 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class AspNetUserTokens 21 | { 22 | 23 | [AutoGenerateColumn(Visible = false, Order = 1, Width = 30, TextEllipsis = true)] 24 | [DisplayName("用户ID")] 25 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 26 | public string UserId { get; set; } 27 | 28 | [DisplayName("名称")] 29 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 30 | public string Name { get; set; } 31 | 32 | [DisplayName("外部登录提供程序")] 33 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 34 | public string LoginProvider { get; set; } 35 | 36 | [DisplayName("值")] 37 | [JsonProperty, Column(StringLength = -2)] 38 | public string Value { get; set; } 39 | 40 | [AutoGenerateColumn(Ignore = true)] 41 | [Navigate(nameof(UserId))] 42 | public virtual AspNetUsers AspNetUsers { get; set; } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/DeviceCodes.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | using System.ComponentModel.DataAnnotations; 12 | #nullable disable 13 | 14 | namespace Densen.Models.ids; 15 | 16 | /// 17 | /// 设备代码 18 | /// 19 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 20 | public partial class DeviceCodes 21 | { 22 | 23 | [Display(Name = "用户代码")] 24 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 25 | public string UserCode { get; set; } 26 | 27 | [Display(Name = "设备代码")] 28 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 29 | public string DeviceCode { get; set; } 30 | 31 | [Display(Name = "主题编号")] 32 | [JsonProperty, Column(StringLength = -2)] 33 | public string SubjectId { get; set; } 34 | 35 | [Display(Name = "会话编号")] 36 | [JsonProperty, Column(StringLength = -2)] 37 | public string SessionId { get; set; } 38 | 39 | [Display(Name = "客户编号")] 40 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 41 | public string ClientId { get; set; } 42 | 43 | [Display(Name = "描述")] 44 | [JsonProperty, Column(StringLength = -2)] 45 | public string Description { get; set; } 46 | 47 | [Display(Name = "创建时间")] 48 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 49 | public string CreationTime { get; set; } 50 | 51 | [Display(Name = "到期")] 52 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 53 | public string Expiration { get; set; } 54 | 55 | [DisplayName("数据")] 56 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 57 | [AutoGenerateColumn(TextEllipsis = true, ComponentType = typeof(BootstrapBlazor.Components.Textarea))] 58 | public string Data { get; set; } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/Keys.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using BootstrapBlazor.Components; 8 | using FreeSql.DataAnnotations; 9 | using Newtonsoft.Json; 10 | using System.ComponentModel; 11 | #nullable disable 12 | 13 | namespace Densen.Models.ids; 14 | 15 | /// 16 | /// 密钥 17 | /// 18 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 19 | public partial class Keys 20 | { 21 | 22 | [DisplayName("ID")] 23 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 24 | public string Id { get; set; } 25 | 26 | [DisplayName("版本")] 27 | [JsonProperty] 28 | public int Version { get; set; } 29 | 30 | [DisplayName("创建")] 31 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 32 | public string Created { get; set; } 33 | 34 | [DisplayName("使用")] 35 | [JsonProperty, Column(StringLength = -2)] 36 | public string Use { get; set; } 37 | 38 | [DisplayName("算法")] 39 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 40 | public string Algorithm { get; set; } 41 | 42 | [DisplayName("是X509证书")] 43 | [JsonProperty] 44 | public int IsX509Certificate { get; set; } 45 | 46 | [DisplayName("数据保护")] 47 | [JsonProperty] 48 | public int DataProtected { get; set; } 49 | 50 | [DisplayName("数据")] 51 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 52 | [AutoGenerateColumn(TextEllipsis = true, ComponentType = typeof(BootstrapBlazor.Components.Textarea))] 53 | public string Data { get; set; } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/PersistedGrants.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using FreeSql.DataAnnotations; 8 | using Newtonsoft.Json; 9 | using System.ComponentModel; 10 | #nullable disable 11 | 12 | namespace Densen.Models.ids; 13 | 14 | /// 15 | /// 持久化保存 16 | /// 17 | [JsonObject(MemberSerialization.OptIn), Table(DisableSyncStructure = true)] 18 | public partial class PersistedGrants 19 | { 20 | 21 | [DisplayName("键值")] 22 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 23 | public string Key { get; set; } 24 | 25 | [DisplayName("类型")] 26 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 27 | public string Type { get; set; } 28 | 29 | [DisplayName("主题编号")] 30 | [JsonProperty, Column(StringLength = -2)] 31 | public string SubjectId { get; set; } 32 | 33 | [DisplayName("会话编号")] 34 | [JsonProperty, Column(StringLength = -2)] 35 | public string SessionId { get; set; } 36 | 37 | [DisplayName("客户编号")] 38 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 39 | public string ClientId { get; set; } 40 | 41 | [DisplayName("描述")] 42 | [JsonProperty, Column(StringLength = -2)] 43 | public string Description { get; set; } 44 | 45 | [DisplayName("创建时间")] 46 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 47 | public string CreationTime { get; set; } 48 | 49 | [DisplayName("到期")] 50 | [JsonProperty, Column(StringLength = -2)] 51 | public string Expiration { get; set; } 52 | 53 | [DisplayName("消耗时间")] 54 | [JsonProperty, Column(StringLength = -2)] 55 | public string ConsumedTime { get; set; } 56 | 57 | [DisplayName("数据")] 58 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 59 | public string Data { get; set; } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/WebAppIdentityUser.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using Microsoft.AspNetCore.Identity; 8 | using System.ComponentModel.DataAnnotations; 9 | 10 | namespace Densen.Identity.Models; 11 | 12 | public class WebAppIdentityUser : IdentityUser 13 | { 14 | 15 | 16 | /// 17 | /// Full name 18 | /// 19 | [Display(Name = "全名")] 20 | [PersonalData] 21 | public string? Name { get; set; } 22 | 23 | /// 24 | /// Birth Date 25 | /// 26 | [Display(Name = "生日")] 27 | [PersonalData] 28 | public DateTime? DOB { get; set; } 29 | 30 | [Display(Name = "识别码")] 31 | public string? UUID { get; set; } 32 | 33 | [Display(Name = "外联")] 34 | public string? provider { get; set; } 35 | 36 | [Display(Name = "税号")] 37 | [PersonalData] 38 | public string? TaxNumber { get; set; } 39 | 40 | [Display(Name = "街道地址")] 41 | [PersonalData] 42 | public string? Street { get; set; } 43 | 44 | [Display(Name = "邮编")] 45 | [PersonalData] 46 | public string? Zip { get; set; } 47 | 48 | [Display(Name = "县")] 49 | [PersonalData] 50 | public string? County { get; set; } 51 | 52 | [Display(Name = "城市")] 53 | [PersonalData] 54 | public string? City { get; set; } 55 | 56 | [Display(Name = "省份")] 57 | [PersonalData] 58 | public string? Province { get; set; } 59 | 60 | [Display(Name = "国家")] 61 | [PersonalData] 62 | public string? Country { get; set; } 63 | 64 | [Display(Name = "类型")] 65 | [PersonalData] 66 | public string? UserRole { get; set; } 67 | } 68 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/___EFMigrationsHistory.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using FreeSql.DataAnnotations; 8 | using Newtonsoft.Json; 9 | 10 | namespace Densen.Models.ids; 11 | 12 | [JsonObject(MemberSerialization.OptIn), Table(Name = "__EFMigrationsHistory", DisableSyncStructure = true)] 13 | public partial class ___EFMigrationsHistory 14 | { 15 | 16 | [JsonProperty, Column(StringLength = -2, IsPrimary = true, IsNullable = false)] 17 | public string MigrationId { get; set; } 18 | 19 | [JsonProperty, Column(StringLength = -2, IsNullable = false)] 20 | public string ProductVersion { get; set; } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/__razor.cshtml.txt: -------------------------------------------------------------------------------- 1 | using FreeSql.DatabaseModel;@{ 2 | var gen = Model as RazorModel; 3 | 4 | Func GetAttributeString = attr => { 5 | if (string.IsNullOrEmpty(attr)) return ""; 6 | return string.Concat(", ", attr.Trim('[', ']')); 7 | }; 8 | Func GetDefaultValue = defval => { 9 | if (string.IsNullOrEmpty(defval)) return ""; 10 | return " = " + defval + ";"; 11 | }; 12 | }@{ 13 | switch (gen.fsql.Ado.DataType) { 14 | case FreeSql.DataType.PostgreSQL: 15 | @:using System; 16 | @:using System.Collections; 17 | @:using System.Collections.Generic; 18 | @:using System.Linq; 19 | @:using System.Reflection; 20 | @:using System.Threading.Tasks; 21 | @:using Newtonsoft.Json; 22 | @:using FreeSql.DataAnnotations; 23 | @:using System.Net; 24 | @:using Newtonsoft.Json.Linq; 25 | @:using System.Net.NetworkInformation; 26 | @:using NpgsqlTypes; 27 | @:using Npgsql.LegacyPostgis; 28 | break; 29 | case FreeSql.DataType.SqlServer: 30 | case FreeSql.DataType.MySql: 31 | default: 32 | @:using System; 33 | @:using System.Collections; 34 | @:using System.Collections.Generic; 35 | @:using System.Linq; 36 | @:using System.Reflection; 37 | @:using System.Threading.Tasks; 38 | @:using Newtonsoft.Json; 39 | @:using FreeSql.DataAnnotations; 40 | break; 41 | } 42 | } 43 | 44 | namespace @gen.NameSpace { 45 | 46 | @if (string.IsNullOrEmpty(gen.table.Comment) == false) { 47 | @:/// 48 | @:/// @gen.table.Comment.Replace("\r\n", "\n").Replace("\n", "\r\n /// ") 49 | @:/// 50 | } 51 | [JsonObject(MemberSerialization.OptIn)@GetAttributeString(gen.GetTableAttribute())] 52 | public partial class @gen.GetCsName(gen.FullTableName) { 53 | 54 | @foreach (var col in gen.columns) { 55 | 56 | if (string.IsNullOrEmpty(col.Comment) == false) { 57 | @:/// 58 | @:/// @col.Comment.Replace("\r\n", "\n").Replace("\n", "\r\n /// ") 59 | @:/// 60 | } 61 | @:@("[JsonProperty" + GetAttributeString(gen.GetColumnAttribute(col, true)) + "]") 62 | @:public @gen.GetCsType(col) @gen.GetCsName(col.Name) { get; set; }@GetDefaultValue(gen.GetColumnDefaultValue(col, false)) 63 | @: 64 | } 65 | } 66 | @gen.GetMySqlEnumSetDefine() 67 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Model/__重新生成.bat: -------------------------------------------------------------------------------- 1 |  2 | FreeSql.Generator -Razor "__razor.cshtml.txt" -NameOptions 0,0,0,0 -NameSpace Densen.Models.ids -DB "Sqlite,Data Source=../../../ids_api.db;" -Filter "View+StoreProcedure" -FileName "{name}.cs" 3 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/Counter.razor: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 | Counter 4 | 5 |

Counter

6 | 7 |

Current count: @currentCount

8 | 9 | 10 | 11 | @code { 12 | private int currentCount = 0; 13 | 14 | private void IncrementCount() 15 | { 16 | currentCount++; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/DemoTableEditTemplate.razor: -------------------------------------------------------------------------------- 1 | @using Densen.Models.ids 2 | 3 |
4 |
5 | 6 |
7 |
8 | 9 |
10 |
11 | 12 | @code { 13 | [Parameter] 14 | [NotNull] 15 | public AspNetUsers? Model { get; set; } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model BlazorApp1.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.AspNetCore.Mvc.RazorPages; 9 | using System.Diagnostics; 10 | 11 | namespace BlazorApp1.Pages; 12 | 13 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 14 | [IgnoreAntiforgeryToken] 15 | public class ErrorModel : PageModel 16 | { 17 | public string? RequestId { get; set; } 18 | 19 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 20 | 21 | private readonly ILogger _logger; 22 | 23 | public ErrorModel(ILogger logger) 24 | { 25 | _logger = logger; 26 | } 27 | 28 | public void OnGet() 29 | { 30 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 31 | } 32 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @using BlazorApp1.Data 3 | 4 | Weather forecast 5 | 6 | 13 | 14 | @code { 15 | 16 | 17 | // 由于使用了FreeSql ORM 数据服务,可以直接取对象 18 | [Inject] IFreeSql? fsql { get; set; } 19 | [Inject] ToastService? toastService { get; set; } 20 | 21 | List IncludeByPropertyNames = new List { 22 | nameof(Cagetory3.Ext) , 23 | }; 24 | 25 | //用演示服务的数据初始化数据库 26 | [Inject] WeatherForecastService? ForecastService { get; set; } 27 | protected override async Task OnAfterRenderAsync(bool firstRender) 28 | { 29 | if (firstRender) 30 | { 31 | Cagetory3.GenDemoDatas(fsql!); 32 | 33 | 34 | //检测一个导航属性是否有效: 35 | 36 | var tbref = fsql!.CodeFirst 37 | .GetTableByEntity(typeof(Cagetory3)) 38 | .GetTableRef(nameof(Cagetory3.Ext), true); 39 | 40 | } 41 | } 42 | 43 | 44 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/FetchDataCagetory.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdataCagetory" 2 | @using BlazorApp1.Data 3 | 4 | Cagetory 5 | 6 | 13 | 14 | @code { 15 | 16 | 17 | // 由于使用了FreeSql ORM 数据服务,可以直接取对象 18 | [Inject] IFreeSql? fsql { get; set; } 19 | [Inject] ToastService? toastService { get; set; } 20 | 21 | List IncludeByPropertyNames = new List { 22 | nameof(Cagetory.Childs) , 23 | }; 24 | 25 | protected override async Task OnAfterRenderAsync(bool firstRender) 26 | { 27 | if (firstRender) 28 | { 29 | Cagetory.GenDemoDatas(fsql!); 30 | } 31 | } 32 | 33 | 34 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/FetchDataCagetory2.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdataCagetory2" 2 | @using BlazorApp1.Data 3 | 4 | Cagetory2 5 | 6 | 12 | 13 | 17 | 18 | @code { 19 | 20 | 21 | // 由于使用了FreeSql ORM 数据服务,可以直接取对象 22 | [Inject] IFreeSql? fsql { get; set; } 23 | [Inject] ToastService? toastService { get; set; } 24 | 25 | List IncludeByPropertyNames = new List { 26 | nameof(Cagetory2.Childs) , 27 | }; 28 | 29 | protected override async Task OnAfterRenderAsync(bool firstRender) 30 | { 31 | if (firstRender) 32 | { 33 | Cagetory2.GenDemoDatas(fsql!); 34 | } 35 | } 36 | 37 | 38 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/FetchDataCagetory3.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdataCagetory3" 2 | @using BlazorApp1.Data 3 | 4 | Cagetory3 - OneToOne 5 | 6 | 12 | 13 | 17 | 18 | 19 | https://github.com/dotnetcore/FreeSql/blob/540f2251b3761bc0caeb2e2894b67272d101f659/FreeSql.Tests/FreeSql.Tests/DataAnnotations/Navigate/OneToOneTest.cs 20 | 21 | @code { 22 | 23 | 24 | // 由于使用了FreeSql ORM 数据服务,可以直接取对象 25 | [Inject] IFreeSql? fsql { get; set; } 26 | [Inject] ToastService? toastService { get; set; } 27 | 28 | List IncludeByPropertyNames = new List { 29 | nameof(Cagetory3.Ext) , 30 | }; 31 | 32 | protected override async Task OnAfterRenderAsync(bool firstRender) 33 | { 34 | if (firstRender) 35 | { 36 | Cagetory3.GenDemoDatas(fsql!); 37 | } 38 | } 39 | 40 | 41 | } -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/Index.razor.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using AmeBlazor.Components; 8 | using BootstrapBlazor.Components; 9 | using Densen.Models.ids; 10 | 11 | namespace BlazorApp1.Pages; 12 | 13 | public partial class Index 14 | { 15 | private List? list; 16 | 17 | protected override void OnInitialized() 18 | { 19 | base.OnInitialized(); 20 | 21 | list = list ?? [ 22 | new RowButtonField() 23 | { 24 | Title = "例1", 25 | Color = Color.Success, 26 | CallbackFunc = 升级, 27 | }, 28 | new RowButtonField() 29 | { 30 | Title = "例2", 31 | Color = Color.Info, 32 | CallbackFunc = 升级, 33 | } 34 | ]; 35 | } 36 | 37 | private async Task 升级(object obj) 38 | { 39 | var item = obj as AspNetRoles; 40 | await ToastService.Information(obj.ToString(), item?.Name); 41 | return true; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/TableCustomComponent.razor: -------------------------------------------------------------------------------- 1 | @page "/customComponent" 2 | @using Densen.Models.ids 3 | 4 | 定制组件 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/TableCustomComponent.razor.cs: -------------------------------------------------------------------------------- 1 | // ********************************** 2 | // Densen Informatica 中讯科技 3 | // 作者:Alex Chow 4 | // e-mail:zhouchuanglin@gmail.com 5 | // ********************************** 6 | 7 | using AmeBlazor.Components; 8 | using BootstrapBlazor.Components; 9 | using Densen.Models.ids; 10 | using Microsoft.AspNetCore.Components; 11 | using System.ComponentModel; 12 | using System.Diagnostics.CodeAnalysis; 13 | using System.Linq.Expressions; 14 | 15 | namespace BlazorApp1.Pages; 16 | 17 | public partial class TableCustomComponent 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Demo/BlazorApp1/Pages/TableDetailsDemo.razor: -------------------------------------------------------------------------------- 1 | @page "/tableDetails" 2 | @using Densen.Models.ids 3 | 4 | 明细表格 5 | 6 | 7 | 8 | 9 |
10 | 30 | 31 | 32 | 33 | 34 |
35 | 36 | @if (!IsFirstLoad) 37 | { 38 |
39 | 59 | 60 |
61 | 62 |