fullstackhero / blazor-starter-kit Goto Github PK
View Code? Open in Web Editor NEWClean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
License: MIT License
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
License: MIT License
Just adding this here so we don't forget :-)
User
Functionality missing:
Edit - At the moment Editing a User only allows the changing of the Active
flag.
Delete - Delete is not implemented yet.
The code below will be more useful if it is modified so that only the changed properties are updated.
public Task UpdateAsync(T entity)
{
_dbContext.Attach(entity);
_dbContext.Entry(entity).State = EntityState.Modified;
return Task.CompletedTask;
}
Hi, thanks for your amazing work.
I have carefully added sortLabel feature into the existing code using the below link.
https://mudblazor.com/components/table
I can populate my data from my API and the searching feature working fine but when I implement the sorting feature using the below code snippet sorting not happening. (seems code not returning after OrderByDirection() method execution.
if (!string.IsNullOrWhiteSpace(state.SortLabel))
{
switch (state.SortLabel)
{
case "date_field":
data = (List<GetAllPagedTicketsResponse>)data.OrderByDirection(state.SortDirection, o => o.ComplaintDateTime?.ToString("yyyy-MM-dd"));
break;
case "area_field":
data = (List<GetAllPagedTicketsResponse>)data.OrderByDirection(state.SortDirection, o => o.Area);
break;
case "subarea_field":
data = (List<GetAllPagedTicketsResponse>)data.OrderByDirection(state.SortDirection, o => o.SubArea);
break;
case "location_field":
data = (List<GetAllPagedTicketsResponse>)data.OrderByDirection(state.SortDirection, o => o.Location);
break;
case "priority_field":
data = (List<GetAllPagedTicketsResponse>)data.OrderByDirection(state.SortDirection, o => o.Priority);
break;
}
}
please advise what I am doing here wrong.
thank you
Are there any plans to add unit Test project
Is your feature request related to a problem? Please describe.
The one thing missing that we need is a system to store setting both application and user.
Describe the solution you'd like
Settings would need to be available on the server and the client for the UI (local storage?) If you are not planning this would you be able to suggest how this would best be done in Blazor?
Describe alternatives you've considered
Have you seen the system implemented in ASP Boilerplate?
Is your feature request related to a problem? Please describe.
no
Describe the solution you'd like
To be able to use for example Azure Authentication instead of username and password
Describe alternatives you've considered
n/a
Additional context
link to sample from microsoft for Azure Auth in a webapi: https://github.com/AzureAD/microsoft-identity-web/blob/master/ProjectTemplates/templates/WebApi-CSharp/Startup.cs
Describe the bug
I try to update profile on : https://localhost:44398/user-profile/4f534928-1503-4972-99fa-5f4e3d7eeedd
To Reproduce
Steps to reproduce the behavior:
Expected behavior
update profile
Screenshots
Desktop (please complete the following information):
Google Chrome
Describe the bug
New user registration allows inputs that are below min-length
To Reproduce
Expected behavior
New User added
Actual behavior
New User not added & UI Dialog hangs
Hi Mukesh,
Thanks for your incredible work.
I see that in your launchsettings you use the same ip/port for server and client.
When I try to do the same I get this error:
"Failed to bind to address https://127.0.0.1:5001: address already in use."
Am I missing something?
thanks for your help
Hi Mukesh,
I just added permission based policy to the server side.
But whatever I do I get unauthorized even with the admin role.
I added the PermissionAuthorizationHandler and the PermissionPolicyProvider to tthe server Api project but I don't see where you use them. I assume it should be in the startup class.
Thanks for your help.
This is great template.
I want to know for complex makemytrip like projects will this work??
I have seen confusing info in other articles on wasm-like silverlight-does not work fast first time and also not on all browsers... or signal R- creates issues in scaling etc.
So if this is just new version of silverlight style can we use this in large web app?
i got this on first load-
Loaded 12.36 MB resourcesThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.
Now if thousands of users start hitting app, initially for all thousands of user will it be slow... this is just not good for large app where people turn away if site does not load immediately. if this is 1 mb or less may be its good for large app. may be this tech is not good at all for makemytrip type of app, only good for small internal apps.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Multi-Tenancy is a widely used architecture to create SaaS applications where the hardware and software resources are shared by the customers (tenants).
It will be great if this feature is added.
It would be awesome if users could register themselves. Currently it appears that this template is for in-house use only, relying on an admin to add new users. This is highly impractical.
Thanks
Describe the bug
UI Hangs when Registering a new User when logged on as admin
To Reproduce
Steps to reproduce the behavior:
Expected behavior
User created and shown in grid
Desktop (please complete the following information):
Screenshots
Additional context
InterceptBeforeHttpAsync
is called and returns without exception or need to refresh token but the response seems to have a status_code of BadRequest
, This status is not handled and so UI hangs.
The problem of the Response.BadRequest is the inner problem
Describe the bug
The sender's avatar does not showed after sending chat message.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The sender's avatar should be showed immediately after sending chat message.
Desktop (please complete the following information):
Can you provide real-time updates in your project?
When two different administrators are in the product catalogue, it would be nice when the view updates automatically in the moment, the other admin adds a new product. (I guess SignalR can handle this?)
Most SignalR examples only implement a chat functionality. Would be awesome, if you could implement this.
First, I would thank you for this template, which will be the default for my upcoming projects, but I know that I will take so much effort to replace MudBlazor with Tailwind css,
I think by using native components will make it easier to choose what css framweork you want to use, Tailwind, bootstrap, bulma,....
Describe the solution you'd like
Is it possible to support Sqlite as the database provider as an alternative to Sql Server
When we try to add permission beside view create edit delete.
For example, ViewDashboard claim, in the blazor client, the current code won't accumulate.
builder .Services .AddAuthorizationCore(options => { foreach (var permissionModule in PermissionModules.GetAllPermissionsModules()) { RegisterPermissionClaimPolicyByModule(options, permissionModule); } })
I tried the registering code inside server side extension. But it won't work.
No action was taken regarding validation in the project.
For example, can a validation infrastructure be created using Fluent Validation?
We can validate with attributes using AOP.
Describe the bug
The error occured after uploading account image.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There is no error.
Desktop (please complete the following information):
Hi,
first of all thanks for such a great setup to work with dotnetcore and blazor.
Issue :
While running the application locally everything worked normally but when I published and deployed the Server project on IIS it got stuck on 1st page where MudBlazor logo is appearing.
error at console
* Assertion at /__w/1/s/src/mono/mono/metadata/assembly.c:4648, condition '<disabled>' not met
It would be helpful if you can help me on this to resolve.
I was considering using Blazorboilerplate. But, due to inadequate documentation for newbies, the project quickly becomes quite complex. We then have to spend a lot to time figuring things out.
I am hoping that the documentation in BLAZORHERO keeps pace with the project and we can follow it, step by step.
For example, I need to use Sendgrid in my project. I am used to using it in different way and would be grateful for steps on how to configure SENDGRID in BLAZORHERO. I don't even know which project to add the Sendgrid NUGET package into, how sad is that? :) :)
Many thanks
Luke
Describe the bug
The error occured when I try to get Audit Trails.
04/06/2021 20:37:57 +03:00 [Error] Failed executing DbCommand ("202"ms) [Parameters=["@__p_1='?' (DbType = Int32), @__userId_0='?' (Size = 4000)"], CommandType='Text', CommandTimeout='30']"\r\n""SELECT TOP(@__p_1) [a].[Id], [a].[AffectedColumns], [a].[DateTime], [a].[NewValues], [a].[OldValues], [a].[PrimaryKey], [a].[TableName], [a].[Type], [a].[UserId]\r\nFROM [AuditTrails] AS [a]\r\nWHERE [a].[UserId] = @__userId_0\r\nORDER BY [a].[Id] DESC"
04/06/2021 20:37:57 +03:00 [Error] An exception occurred while iterating over the results of a query for context type '"BlazorHero.CleanArchitecture.Infrastructure.Contexts.BlazorHeroContext"'."\r\n""Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'AuditTrails'.\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__169_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\nClientConnectionId:e12a8b91-51d5-4146-9cdb-7d4db9810df2\r\nError Number:208,State:1,Class:16"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There are no errors.
Desktop (please complete the following information):
No matter what I do, the database name remains BlazorHero.CleanArchitecture
. I even tried context.Database.Migrate()
in Program.cs and the name is still BlazorHero.CleanArchitecture
. Aliens are taking over the project!!
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Hangfire": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"AppConfiguration": {
"Secret": "S0M3RAN0MS3CR3T!1!MAG1C!1!"
},
"ConnectionStrings": {
"DefaultConnection": "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=BrokenDatabase;Integrated Security=True;MultipleActiveResultSets=True"
},
"MailConfiguration": {
"From": "[email protected]",
"Host": "smtp.ethereal.email",
"Port": 587,
"UserName": "[email protected]",
"Password": "vAKmWQB8CyPUBg8rBQ",
"DisplayName": "Mukesh Murugan"
},
//For Serilog Configuration, refer https://codewithmukesh.com/blog/serilog-in-aspnet-core-3-1/
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Error",
"Microsoft.Hosting.Lifetime": "Information",
"System": "Information",
"Hangfire": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp} [{Level}] {Message}{NewLine:1}"
}
},
{
"Name": "File",
"Args": {
"path": "Logs\\log.txt",
"rollingInterval": "Day"
}
}
],
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithProcessId",
"WithThreadId"
],
"Properties": {
"Application": "BlazorHero.CleanArchitecture.Server"
}
}
}```
In file CleanArchitecture/BlazorHero.CleanArchitecture/Server/appsettings.json
did you store valid password to ethereal.email ? :P
I was clicking around in the application, just random clicks and entering a few products etc.
When clicking on the HANGFIRE menu item, I got an error - please see attached screenshot. Unfortunately it seems to be random. I have been trying to create the steps necessary to reproduce but have not succeeded.
Thanks, Luke.
The following endpoint is unprotected since [Authorize] attribute is not used.
How can we protect below endpoint using role permissions rather than roles?
BlazorHero.CleanArchitecture.Server.Controllers.v1.Catalog
{
public class ProductsController : BaseApiController<ProductsController>
{
[HttpGet]
public async Task<IActionResult> GetAll.......
.
.
}
}
How can I protect this endpoint by adding the [Authorize (Policy = "Products.View")] attribute to Jwt.
How can I verify role permissions after I have protected them.
You have always used permissions on the UI side in this project and other projects, but you never used permissions on the Api side.
It will be very nice if you use an example on the api side in this project.
Hi, I'm just kidding.
I just want to say thank you for the amazing efforts.
Good luck!
Describe the bug
I went to the repo and clone it in Visual Studio 2019, and after building i found the following error;
Severity Code Description Project File Line Suppression State
Error NETSDK1004 Assets file 'C:\Repos\Training\BlazorHero - Clean Architecture Template\BlazorHero.CleanArchitecture\Server\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. BlazorHero.CleanArchitecture.Server C:\Program Files\dotnet\sdk\5.0.201\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 241
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The solution build without issues
Desktop (please complete the following information):
Additional context
I tried to do a dotnet restore in the project and found the following error:
dotnet restore
Determining projects to restore...
C:\Program Files\dotnet\sdk\5.0.201\NuGet.targets(131,5): error : Found invalid data while decoding. [C:\Repos\Training\BlazorHero - Clean Architecture Template\BlazorHero.CleanArchitecture\Server\BlazorHero.CleanArchitecture.Server.csproj]
Describe the bug
The project/solution Crashes When i try to upload a image to the profile
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The image is uploaded if we restart the solution (RUN) but crashes on the process
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
Some people dont use facebook, and wont be able to access the video without an account
Describe the solution you'd like
Put it on a more inclusive platform like Vimeo or YouTube
Beautiful template, but currently there is no means to register a new user? I would imagine this would be a "must have" in any application.
Thanks
Luke
Hi Mukesh!
Amazingly insane project dude! The speed of development makes me feel decidedly ordinary :)
Just one question: I see when making entries to the DB, its multi tenant? What I mean, is that if I as admin add new category, it does not show for the normal user? I read that this template may have the ability to switch between single user/DB and multi? If so, is it implemented or configurable at this point?
Many thanks for the great work!
Luke Vincent
Hi,
i've created the this template via nuget comand "dotnet new BlazorHero.CleanArchitecture"
I starting the server with .net console (not IIS). All builds fine but the console writes some exceptions:
I have not changed anything yet.
How can I fix these errors?
Thanks!
Sending HTTP request GET https://localhost:5001/api/identity/account/profile-picture/c6feb5e1-61e6-426a-9117-e3d253ef1dab crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: TypeError: Failed to fetch System.Net.Http.HttpRequestException: TypeError: Failed to fetch at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Demo.Client.Infrastructure.Authentication.AuthenticationHeaderHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\code\private\Demo\Demo.Client.Infrastructure\Authentication\AuthenticationHeaderHandler.cs:line 30 at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Toolbelt.Blazor.HttpClientInterceptorHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Toolbelt.Blazor.HttpClientInterceptorHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken) at Demo.Client.Infrastructure.Managers.Identity.Account.AccountManager.GetProfilePictureAsync(String userId) in C:\code\private\Demo\Demo.Client.Infrastructure\Managers\Identity\Account\AccountManager.cs:line 33 at Demo.Client.Shared.Components.UserCard.LoadDataAsync() in C:\code\private\Demo\Demo\Client\Shared\Components\UserCard.razor.cs:line 36 at Demo.Client.Shared.Components.UserCard.OnInitializedAsync() in C:\code\private\Demo\Demo\Client\Shared\Components\UserCard.razor.cs:line 20 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle) crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: TypeError: Failed to fetch System.Net.Http.HttpRequestException: TypeError: Failed to fetch at System.Net.Http.BrowserHttpHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Demo.Client.Infrastructure.Authentication.AuthenticationHeaderHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in C:\code\private\Demo\Demo.Client.Infrastructure\Authentication\AuthenticationHeaderHandler.cs:line 30 at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Toolbelt.Blazor.HttpClientInterceptorHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at Toolbelt.Blazor.HttpClientInterceptorHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken) at Demo.Client.Infrastructure.Managers.Identity.Account.AccountManager.GetProfilePictureAsync(String userId) in C:\code\private\Demo\Demo.Client.Infrastructure\Managers\Identity\Account\AccountManager.cs:line 33 at Demo.Client.Shared.Components.UserCard.LoadDataAsync() in C:\code\private\Demo\Demo\Client\Shared\Components\UserCard.razor.cs:line 36 at Demo.Client.Shared.Components.UserCard.OnInitializedAsync() in C:\code\private\Demo\Demo\Client\Shared\Components\UserCard.razor.cs:line 20 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle) Debugging hotkey: Shift+Alt+D (when application has focus) �[0m�[48;5;127m�[38;5;231mblazor�[0m�[1m Loaded 12.36 MB resources �[0mThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.�[0m Loaded 12.36 MB resources from cache info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: ClaimsAuthorizationRequirement:Claim.Type=Permission and Claim.Value is one of the following values: (Permissions.Roles.View) info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: ClaimsAuthorizationRequirement:Claim.Type=Permission and Claim.Value is one of the following values: (Permissions.Users.View) info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: ClaimsAuthorizationRequirement:Claim.Type=Permission and Claim.Value is one of the following values: (Permissions.Products.View) info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2] Authorization failed. These requirements were not met: ClaimsAuthorizationRequirement:Claim.Type=Permission and Claim.Value is one of the following values: (Permissions.Brands.View) info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful. info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1] Authorization was successful.
Describe the bug
when i change expiration date to something like 20min
next api call will result in exception in
BlazorHero.CleanArchitecture.Server.Extensions.ServiceCollectionExtensions
OnChallenge = context =>
{
.......
context.Response.StatusCode = 401;
.......
}
To Reproduce
Steps to reproduce the behavior:
Expected behavior
either logout user and require new login or refresh token
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
none
Is your feature request related to a problem? Please describe.
In able to handling long-running requests with background services or out of process with an Azure Function, HangFire, worker service. Completing work out-of-process is especially beneficial for CPU-intensive tasks. Then use real-time communication options, such as SignalR, to communicate with clients asynchronously about progress.
Describe the solution you'd like
Use Case: Generate big report or process some complex workflows after submit request.
I don´t know where to share code so i'm doing here.
add MySql.EntityFrameworkCore nuget package to Infrastructure project and Web/Server project
Code changes to use MySQL
Source/Infrasctructure/Contexts/BlazorHeroContext.cs:
protected override void OnModelCreating(ModelBuilder builder)
{
foreach (var property in builder.Model.GetEntityTypes()
.SelectMany(t => t.GetProperties())
.Where(p => p.ClrType == typeof(decimal) || p.ClrType == typeof(decimal?)))
{
property.SetColumnType("decimal(18,2)");
}
base.OnModelCreating(builder);
builder.Entity<ChatHistory>(entity =>
{
entity.ToTable("ChatHistory");
entity.HasOne(d => d.FromUser)
.WithMany(p => p.ChatHistoryFromUsers)
.HasForeignKey(d => d.FromUserId)
.OnDelete(DeleteBehavior.ClientSetNull);
entity.HasOne(d => d.ToUser)
.WithMany(p => p.ChatHistoryToUsers)
.HasForeignKey(d => d.ToUserId)
.OnDelete(DeleteBehavior.ClientSetNull);
});
builder.Entity<BlazorHeroUser>(entity =>
{
entity.ToTable(name: "Users");
});
builder.Entity<IdentityRole>(entity =>
{
entity.ToTable(name: "Roles");
});
builder.Entity<IdentityUserRole<string>>(entity =>
{
entity.ToTable("UserRoles");
});
builder.Entity<IdentityUserClaim<string>>(entity =>
{
entity.ToTable("UserClaims");
});
builder.Entity<IdentityUserLogin<string>>(entity =>
{
entity.ToTable("UserLogins");
});
builder.Entity<IdentityRoleClaim<string>>(entity =>
{
entity.ToTable("RoleClaims");
});
builder.Entity<IdentityUserToken<string>>(entity =>
{
entity.ToTable("UserTokens");
});
builder.Entity<IdentityUser>(entity => entity.Property(m => m.Id).HasMaxLength(85));
builder.Entity<IdentityUser>(entity => entity.Property(m => m.NormalizedEmail).HasMaxLength(85));
builder.Entity<IdentityUser>(entity => entity.Property(m => m.NormalizedUserName).HasMaxLength(85));
builder.Entity<IdentityRole>(entity => entity.Property(m => m.Id).HasMaxLength(85));
builder.Entity<IdentityRole>(entity => entity.Property(m => m.NormalizedName).HasMaxLength(85));
builder.Entity<IdentityUserLogin<string>>(entity => entity.Property(m => m.LoginProvider).HasMaxLength(85));
builder.Entity<IdentityUserLogin<string>>(entity => entity.Property(m => m.ProviderKey).HasMaxLength(85));
builder.Entity<IdentityUserLogin<string>>(entity => entity.Property(m => m.UserId).HasMaxLength(85));
builder.Entity<IdentityUserRole<string>>(entity => entity.Property(m => m.UserId).HasMaxLength(85));
builder.Entity<IdentityUserRole<string>>(entity => entity.Property(m => m.RoleId).HasMaxLength(85));
builder.Entity<IdentityUserToken<string>>(entity => entity.Property(m => m.UserId).HasMaxLength(85));
builder.Entity<IdentityUserToken<string>>(entity => entity.Property(m => m.LoginProvider).HasMaxLength(85));
builder.Entity<IdentityUserToken<string>>(entity => entity.Property(m => m.Name).HasMaxLength(85));
builder.Entity<IdentityUserClaim<string>>(entity => entity.Property(m => m.Id).HasMaxLength(85));
builder.Entity<IdentityUserClaim<string>>(entity => entity.Property(m => m.UserId).HasMaxLength(85));
builder.Entity<IdentityRoleClaim<string>>(entity => entity.Property(m => m.Id).HasMaxLength(85));
builder.Entity<IdentityRoleClaim<string>>(entity => entity.Property(m => m.RoleId).HasMaxLength(85));
}
Server/Extensions/ServiceCollectionExtensions.cs
public static IServiceCollection AddDatabase(
this IServiceCollection services,
IConfiguration configuration)
=> services
.AddDbContext<BlazorHeroContext>(options => options
.UseMySQL(configuration.GetConnectionString("DefaultConnection"))
//.UseSqlServer(configuration.GetConnectionString("DefaultConnection"))
)
.AddTransient<IDatabaseSeeder, DatabaseSeeder>();
Wish is helpful !!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.