diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.sln b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.sln
new file mode 100644
index 0000000..9fc3e14
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.10.35004.147
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorAppRadzenNet8UpgradeRadzen4to5", "BlazorAppRadzenNet8UpgradeRadzen4to5\BlazorAppRadzenNet8UpgradeRadzen4to5.csproj", "{2A3D3409-F811-4BAD-81B1-10243349D26C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2A3D3409-F811-4BAD-81B1-10243349D26C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2A3D3409-F811-4BAD-81B1-10243349D26C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2A3D3409-F811-4BAD-81B1-10243349D26C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2A3D3409-F811-4BAD-81B1-10243349D26C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E78B5F08-4975-4B9B-B9F8-DFDD0DAE2608}
+ EndGlobalSection
+EndGlobal
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.csproj b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.csproj
new file mode 100644
index 0000000..dffdee4
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5.csproj
@@ -0,0 +1,16 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/App.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/App.razor
new file mode 100644
index 0000000..5890d61
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/App.razor
@@ -0,0 +1,22 @@
+@inject NavigationManager NavigationManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/MainLayout.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/MainLayout.razor
new file mode 100644
index 0000000..353b896
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/MainLayout.razor
@@ -0,0 +1,59 @@
+@inherits LayoutComponentBase
+
+@inject IJSRuntime JSRuntime
+@inject NavigationManager NavigationManager
+@inject DialogService DialogService
+@inject ContextMenuService ContextMenuService
+@inject TooltipService TooltipService
+@inject NotificationService NotificationService
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @Body
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@code {
+ bool sidebarExpanded = true;
+
+ void SidebarToggleClick()
+ {
+ sidebarExpanded = !sidebarExpanded;
+ }
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/NavMenu.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/NavMenu.razor
new file mode 100644
index 0000000..92d89ab
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Layout/NavMenu.razor
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Create.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Create.razor
new file mode 100644
index 0000000..a5ce9d4
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Create.razor
@@ -0,0 +1,74 @@
+@page "/BlogPost/Create"
+
+
+
+@if (blogPostViewModel == null)
+{
+ Loading...
+}
+else
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+@code {
+ private BlogPostViewModel? blogPostViewModel;
+
+ protected override void OnInitialized()
+ {
+ blogPostViewModel = new();
+ }
+
+ protected async Task HandleValidSubmit()
+ {
+ if (blogPostViewModel == null) return;
+
+ var blogPost = Mapper.Map(blogPostViewModel);
+ bool result = await BlogPostService.AddBlogPostAsync(blogPost);
+ if (result)
+ NavigationManager.NavigateTo("/BlogPost/");
+
+ }
+
+ private void NavigatetoBlogPostIndex() => NavigationManager.NavigateTo("/BlogPost");
+
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Delete.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Delete.razor
new file mode 100644
index 0000000..5b697a4
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Delete.razor
@@ -0,0 +1,89 @@
+@page "/BlogPost/Delete/{id:int}"
+
+Delete
+
+@if (blogPostViewModel == null)
+{
+ Loading...
+}
+else
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+@code {
+
+ [Parameter]
+ public int id { get; set; }
+
+ BlogPostViewModel? blogPostViewModel;
+
+ protected override async Task OnInitializedAsync()
+ {
+ if (blogPostViewModel == null)
+ {
+ var blogPost = await BlogPostService.GetbyId(id);
+ if (blogPost == null)
+ return;
+
+ blogPostViewModel = Mapper.Map(blogPost);
+ }
+ }
+
+ private async void RemoveButtonClick()
+ {
+ bool result = await BlogPostService.DeletebyIdAsync(id);
+ if (result)
+ NavigationManager.NavigateTo("/BlogPost");
+ }
+
+ private void NavigatetoBlogPostIndex() => NavigationManager.NavigateTo("/BlogPost");
+
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Detail.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Detail.razor
new file mode 100644
index 0000000..1722ef9
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Detail.razor
@@ -0,0 +1,78 @@
+@page "/BlogPost/Detail/{id:int}"
+
+Detail
+
+@if (blogPostViewModel == null)
+{
+ Loading...
+}
+else
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+@code {
+
+ [Parameter]
+ public int id { get; set; }
+
+ BlogPostViewModel? blogPostViewModel;
+
+ protected override async Task OnInitializedAsync()
+ {
+ if (blogPostViewModel == null)
+ {
+ var blogPost = await BlogPostService.GetbyId(id);
+ if (blogPost == null)
+ return;
+
+ blogPostViewModel = Mapper.Map(blogPost);
+ }
+ }
+
+
+ private void NavigatetoBlogPostIndex() => NavigationManager.NavigateTo("/BlogPost");
+
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Edit.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Edit.razor
new file mode 100644
index 0000000..b5b43ef
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Edit.razor
@@ -0,0 +1,101 @@
+@page "/BlogPost/Edit/{id:int}"
+
+Edit
+
+@if (blogPostViewModel == null)
+{
+ Loading...
+}
+else
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+@code {
+
+ [Parameter]
+ public int id { get; set; }
+
+ BlogPostViewModel? blogPostViewModel;
+
+ protected override async Task OnInitializedAsync()
+ {
+ if (blogPostViewModel == null)
+ {
+ var blogPost = await BlogPostService.GetbyId(id);
+ if (blogPost == null)
+ return;
+
+ blogPostViewModel = Mapper.Map(blogPost);
+ }
+ }
+
+
+ void OnPaste(HtmlEditorPasteEventArgs args)
+ {
+ }
+
+ void OnChange(string html)
+ {
+ }
+
+ void OnInput(string html)
+ {
+ }
+
+ void OnExecute(HtmlEditorExecuteEventArgs args)
+ {
+ }
+
+ protected async Task HandleValidSubmit()
+ {
+ if (blogPostViewModel == null) return;
+
+ var blogPost = Mapper.Map(blogPostViewModel);
+ bool result = await BlogPostService.UpdateBlogPostAsync(id, blogPost);
+ if (result)
+ NavigationManager.NavigateTo("/BlogPost/");
+ }
+
+ private void NavigatetoBlogPostIndex() => NavigationManager.NavigateTo("/BlogPost");
+
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Index.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Index.razor
new file mode 100644
index 0000000..060fd33
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/Index.razor
@@ -0,0 +1,81 @@
+@page "/BlogPost"
+
+Posts
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@code {
+
+ const int itemPageSize = 10;
+ private bool isLoading;
+ private int totalCount;
+ private IEnumerable? blogPosts;
+
+ private async Task LoadData(LoadDataArgs args)
+ {
+ isLoading = true;
+
+ var result = await BlogPostService.GetBlogPostsAsync(filter: args.Filter, top: args.Top, skip: args.Skip, orderby: args.OrderBy, count: true);
+
+ blogPosts = Mapper.Map, IEnumerable>(result.Result);
+ totalCount = result.TotalCount;
+
+ isLoading = false;
+ }
+
+ private void NavigatetoCreate() => NavigationManager.NavigateTo("/BlogPost/Create");
+ private void NavigatetoDetail(int id) => NavigationManager.NavigateTo($"/BlogPost/Detail/{id}");
+ private void NavigatetoEdit(int id) => NavigationManager.NavigateTo($"/BlogPost/Edit/{id}");
+ private void NavigatetoDelete(int id) => NavigationManager.NavigateTo($"/BlogPost/Delete/{id}");
+
+}
+
+
+
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/_Imports.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/_Imports.razor
new file mode 100644
index 0000000..fbd5c44
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/BlogPost/_Imports.razor
@@ -0,0 +1,7 @@
+@using BlazorAppRadzenNet8UpgradeRadzen4to5.Data;
+@using BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+@using BlazorAppRadzenNet8UpgradeRadzen4to5.Services;
+@using BlazorAppRadzenNet8UpgradeRadzen4to5.ViewModels;
+
+@inject NavigationManager NavigationManager
+@inject BlogPostService BlogPostService
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Error.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Error.razor
new file mode 100644
index 0000000..576cc2d
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Error.razor
@@ -0,0 +1,36 @@
+@page "/Error"
+@using System.Diagnostics
+
+Error
+
+Error.
+An error occurred while processing your request.
+
+@if (ShowRequestId)
+{
+
+ Request ID: @RequestId
+
+}
+
+Development Mode
+
+ Swapping to Development environment will display more detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
+
+@code{
+ [CascadingParameter]
+ private HttpContext? HttpContext { get; set; }
+
+ private string? RequestId { get; set; }
+ private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ protected override void OnInitialized() =>
+ RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Home.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Home.razor
new file mode 100644
index 0000000..9001e0b
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Pages/Home.razor
@@ -0,0 +1,7 @@
+@page "/"
+
+Home
+
+Hello, world!
+
+Welcome to your new app.
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Routes.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Routes.razor
new file mode 100644
index 0000000..36205bb
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/Routes.razor
@@ -0,0 +1,17 @@
+
+
+
+ @* *@
+
+
+ Not found
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/_Imports.razor b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/_Imports.razor
new file mode 100644
index 0000000..f4007c3
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Components/_Imports.razor
@@ -0,0 +1,16 @@
+@using System.Net.Http
+@using System.Net.Http.Json
+@using Microsoft.AspNetCore.Components.Forms
+@using Microsoft.AspNetCore.Components.Routing
+@using Microsoft.AspNetCore.Components.Web
+@using static Microsoft.AspNetCore.Components.Web.RenderMode
+@using Microsoft.AspNetCore.Components.Web.Virtualization
+@using Microsoft.JSInterop
+@using BlazorAppRadzenNet8UpgradeRadzen4to5
+@using BlazorAppRadzenNet8UpgradeRadzen4to5.Components
+
+@using MapsterMapper
+@using Radzen
+@using Radzen.Blazor
+
+@inject IMapper Mapper
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/ApplicationDbContext.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/ApplicationDbContext.cs
new file mode 100644
index 0000000..725ce46
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/ApplicationDbContext.cs
@@ -0,0 +1,19 @@
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+using Microsoft.EntityFrameworkCore;
+
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.Data;
+
+public class ApplicationDbContext : DbContext
+{
+ public ApplicationDbContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ public DbSet BlogPosts => Set();
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ base.OnModelCreating(modelBuilder);
+ }
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/SeedData.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/SeedData.cs
new file mode 100644
index 0000000..fbf87cd
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Data/SeedData.cs
@@ -0,0 +1,101 @@
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.Data;
+
+public class SeedData
+{
+ private readonly ApplicationDbContext _context;
+
+ public SeedData(ApplicationDbContext context)
+ {
+ _context = context;
+ }
+
+ public async Task CreateInitialData()
+ {
+ var posts = GetAllBlogPosts();
+ await _context.BlogPosts.AddRangeAsync(posts);
+ await _context.SaveChangesAsync();
+ }
+
+ private static IEnumerable GetAllBlogPosts()
+ {
+ List posts = new();
+ for (int i = 0; i < 50; i++)
+ {
+ BlogPost post = new() { Id = i + 1, Title = titles[i], Content = contents[i % 10] };
+ posts.Add(post);
+ }
+
+ return posts;
+ }
+
+ private static readonly string[] titles = {
+ "Introduction to Object-Oriented Programming",
+ "Mastering Data Structures and Algorithms",
+ "Building Web Applications with ASP.NET",
+ "Creating Mobile Apps with Xamarin",
+ "Exploring Artificial Intelligence and Machine Learning",
+ "Understanding Functional Programming Concepts",
+ "Developing Games with Unity",
+ "Securing Web Applications from Cyber Attacks",
+ "Optimizing Code Performance for Better Efficiency",
+ "Implementing Design Patterns in Software Development",
+ "Testing and Debugging Strategies for Reliable Software",
+ "Working with Databases and SQL",
+ "Building Responsive User Interfaces with HTML and CSS",
+ "Exploring Cloud Computing and Serverless Architecture",
+ "Developing Cross-Platform Applications with React Native",
+ "Introduction to Internet of Things (IoT)",
+ "Creating Scalable Microservices with Docker and Kubernetes",
+ "Understanding Network Protocols and TCP/IP",
+ "Building RESTful APIs with Node.js and Express",
+ "Exploring Big Data Analytics and Apache Hadoop",
+ "Mastering Version Control with Git and GitHub",
+ "Developing Desktop Applications with WPF",
+ "Securing Mobile Applications from Malicious Attacks",
+ "Optimizing Database Performance with Indexing",
+ "Implementing Continuous Integration and Deployment",
+ "Testing Mobile Apps on Different Platforms",
+ "Working with NoSQL Databases like MongoDB",
+ "Building Progressive Web Apps with React",
+ "Exploring Quantum Computing and Quantum Algorithms",
+ "Introduction to Cybersecurity and Ethical Hacking",
+ "Creating Chatbots with Natural Language Processing",
+ "Understanding Software Development Life Cycle",
+ "Developing Augmented Reality (AR) Applications",
+ "Securing Web APIs with OAuth and JWT",
+ "Optimizing Front-End Performance for Better User Experience",
+ "Implementing Machine Learning Models with TensorFlow",
+ "Testing Web Applications for Cross-Browser Compatibility",
+ "Working with Blockchain Technology and Smart Contracts",
+ "Building Real-Time Applications with SignalR",
+ "Exploring Cryptography and Encryption Techniques",
+ "Introduction to Agile Software Development",
+ "Creating Voice User Interfaces with Amazon Alexa",
+ "Understanding Web Accessibility and Inclusive Design",
+ "Developing Natural Language Processing Applications",
+ "Securing Cloud Infrastructure and Services",
+ "Optimizing Backend Performance for Scalability",
+ "Implementing Continuous Monitoring and Alerting",
+ "Testing APIs with Postman and Swagger",
+ "Working with Data Visualization Libraries like D3.js",
+ "Building E-commerce Applications with Shopify",
+ "Exploring Robotic Process Automation (RPA)",
+ "Introduction to DevOps and CI/CD Pipelines"
+ };
+
+ private static readonly string[] contents = new string[]
+ {
+ "Lorem ipsum dolor sit amet, consectetur t.",
+ "Sed ut perspiciatis unde omnis iste natuccusantium doloremque laudantium.",
+ "Nemo enim ipsam voluptatem quia voluptas aut fugit.",
+ "Quis autem vel eum iure reprehenderit quesse quam nihil molestiae consequatur.",
+ "At vero eos et accusamus et iusto odio d.",
+ "Similique sunt in culpa qui officia de.",
+ "Et harum quidem rerum facilis est et expio.",
+ "Nam libero tempore, cum soluta nobis est.",
+ "Omnis voluptas assumenda est, omnis dolo",
+ "Temporibus autem quibusdam et aut offic"
+ };
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Models/BlogPost.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Models/BlogPost.cs
new file mode 100644
index 0000000..b20f9ad
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Models/BlogPost.cs
@@ -0,0 +1,8 @@
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+
+public class BlogPost
+{
+ public int Id { get; set; }
+ public string Title { get; set; } = string.Empty;
+ public string Content { get; set; } = string.Empty;
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Program.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Program.cs
new file mode 100644
index 0000000..f2d190e
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Program.cs
@@ -0,0 +1,94 @@
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Components;
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Data;
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Services;
+using BlazorAppRadzenNet8UpgradeRadzen4to5.ViewModels;
+using Mapster;
+using MapsterMapper;
+using Microsoft.EntityFrameworkCore;
+using Radzen;
+using System.Reflection;
+
+internal class Program
+{
+ private static void Main(string[] args)
+ {
+ var builder = WebApplication.CreateBuilder(args);
+
+
+ // Add services to the container.
+ builder.Services.AddDbContext(options =>
+ options.UseInMemoryDatabase("ConnectionInMemory")
+ );
+ builder.Services.AddScoped();
+ builder.Services.AddScoped();
+
+ // Radzen Services
+ builder.Services.AddScoped();
+ builder.Services.AddScoped();
+ builder.Services.AddScoped();
+ builder.Services.AddScoped();
+
+ // Add mapster mapper
+ builder.Services.AddMapster();
+
+ builder.Services.CreateDatabase().GetAwaiter().GetResult();
+
+ builder.Services.AddDatabaseDeveloperPageExceptionFilter();
+
+ // Add services to the container.
+
+ // Add services to the container.
+ builder.Services.AddRazorComponents()
+ .AddInteractiveServerComponents().AddHubOptions(options => options.MaximumReceiveMessageSize = 10 * 1024 * 1024);
+
+ builder.Services.AddControllers();
+ builder.Services.AddRadzenComponents();
+ builder.Services.AddHttpClient();
+
+ var app = builder.Build();
+
+ // Configure the HTTP request pipeline.
+ if (!app.Environment.IsDevelopment())
+ {
+ app.UseExceptionHandler("/Error", createScopeForErrors: true);
+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+ app.UseHsts();
+ }
+
+ app.UseHttpsRedirection();
+ app.MapControllers();
+ app.UseStaticFiles();
+ app.UseAntiforgery();
+
+ app.MapRazorComponents()
+ .AddInteractiveServerRenderMode();
+
+ app.Run();
+ }
+}
+
+public static class ServiceCollectionExtensions
+{
+ public static async Task CreateDatabase(this IServiceCollection services)
+ {
+ using (IServiceScope tmp = services.BuildServiceProvider().CreateScope())
+ {
+ await using var _context = tmp.ServiceProvider.GetRequiredService();
+ var seedData = tmp.ServiceProvider.GetRequiredService();
+ await seedData.CreateInitialData();
+ }
+ }
+}
+
+public static class MapsterConfiguration
+{
+ public static void AddMapster(this IServiceCollection services)
+ {
+ var typeAdapterConfig = TypeAdapterConfig.GlobalSettings;
+ Assembly applicationAssembly = typeof(BaseViewModel<,>).Assembly;
+ typeAdapterConfig.Scan(applicationAssembly);
+
+ var mapperConfig = new Mapper(typeAdapterConfig);
+ services.AddSingleton(mapperConfig);
+ }
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Properties/launchSettings.json b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Properties/launchSettings.json
new file mode 100644
index 0000000..2862820
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Properties/launchSettings.json
@@ -0,0 +1,14 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "https": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "launchBrowser": true,
+ "applicationUrl": "https://localhost:5001;http://localhost:5000",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Services/BlogPostService.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Services/BlogPostService.cs
new file mode 100644
index 0000000..c2efce8
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/Services/BlogPostService.cs
@@ -0,0 +1,90 @@
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Data;
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+using Microsoft.EntityFrameworkCore;
+using Radzen;
+using System.Linq.Dynamic.Core;
+
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.Services;
+
+public class BlogPostService
+{
+ private readonly ApplicationDbContext _context;
+
+ public BlogPostService(ApplicationDbContext context)
+ {
+ _context = context;
+ }
+
+ public Task GetbyId(int id)
+ {
+ return _context.BlogPosts.FirstOrDefaultAsync(x => x.Id == id);
+ }
+
+ public async Task<(IEnumerable Result, int TotalCount)> GetBlogPostsAsync(string? filter = default, int? top = default, int? skip = default, string? orderby = default, string? expand = default, string? select = default, bool? count = default)
+ {
+ var query = _context.BlogPosts.AsQueryable();
+
+ if (!string.IsNullOrEmpty(filter))
+ query = query.Where(filter);
+
+ if (!string.IsNullOrEmpty(orderby))
+ query = query.OrderBy(orderby);
+
+ int totalCount = 0;
+ if (count == true)
+ totalCount = query.Count();
+
+ IEnumerable? result;
+ if (skip == null || top == null)
+ result = await query.ToListAsync();
+ else
+ result = await query.Skip(skip.Value).Take(top.Value).ToListAsync();
+
+ return (result, totalCount);
+ }
+
+ public async Task AddBlogPostAsync(BlogPost blogPost)
+ {
+ try
+ {
+ await _context.BlogPosts.AddAsync(blogPost);
+ await _context.SaveChangesAsync();
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public async Task UpdateBlogPostAsync(int id, BlogPost blogPost)
+ {
+ try
+ {
+ var oldBlogPost = _context.BlogPosts.FirstOrDefault(x => x.Id == id);
+ if (oldBlogPost == null) return false;
+
+ oldBlogPost.Title = blogPost.Title;
+ oldBlogPost.Content = blogPost.Content;
+
+ await _context.SaveChangesAsync();
+ }
+ catch (Exception ex)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ public async Task DeletebyIdAsync(int id)
+ {
+ var blogPost = await _context.BlogPosts.FirstOrDefaultAsync(x => x.Id == id);
+ if (blogPost == null)
+ return false;
+
+ _context.BlogPosts.Remove(blogPost);
+ await _context.SaveChangesAsync();
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BaseViewModel.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BaseViewModel.cs
new file mode 100644
index 0000000..3a9a74e
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BaseViewModel.cs
@@ -0,0 +1,46 @@
+using Mapster;
+
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.ViewModels;
+
+///
+/// Model <-> ViewModel Mapping
+///
+/// ViewModel
+/// Model
+public abstract class BaseViewModel : IRegister
+ where TViewModel : class, new()
+ where TModel : class, new()
+{
+
+ public TModel ToModel()
+ {
+ return this.Adapt();
+ }
+
+ public TModel ToModel(TModel model)
+ {
+ return (this as TViewModel).Adapt(model);
+ }
+
+ public static TViewModel FromModel(TModel model)
+ {
+ return model.Adapt();
+ }
+
+ private TypeAdapterConfig Config { get; set; }
+
+ public virtual void AddCustomMappings() { }
+
+
+ protected TypeAdapterSetter SetCustomMappings()
+ => Config.ForType();
+
+ protected TypeAdapterSetter SetCustomMappingsInverse()
+ => Config.ForType();
+
+ public void Register(TypeAdapterConfig config)
+ {
+ Config = config;
+ AddCustomMappings();
+ }
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BlogPostViewModel.cs b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BlogPostViewModel.cs
new file mode 100644
index 0000000..f48911d
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/ViewModels/BlogPostViewModel.cs
@@ -0,0 +1,19 @@
+using BlazorAppRadzenNet8UpgradeRadzen4to5.Models;
+using System.ComponentModel.DataAnnotations;
+
+namespace BlazorAppRadzenNet8UpgradeRadzen4to5.ViewModels;
+
+public class BlogPostViewModel : BaseViewModel
+{
+ public int Id { get; set; }
+
+ [Required(AllowEmptyStrings = false, ErrorMessage = "Title can not be empty")]
+ public string Title { get; set; } = string.Empty;
+
+ [Required(AllowEmptyStrings = false, ErrorMessage = "Content can not be empty")]
+ public string Content { get; set; } = string.Empty;
+
+ public string TitleShort { get; set; } = string.Empty;
+ public string ContentShort { get; set; } = string.Empty;
+
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.Development.json b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.Development.json
new file mode 100644
index 0000000..0c208ae
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.Development.json
@@ -0,0 +1,8 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ }
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.json b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.json
new file mode 100644
index 0000000..10f68b8
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft.AspNetCore": "Warning"
+ }
+ },
+ "AllowedHosts": "*"
+}
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/css/site.css b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/css/site.css
new file mode 100644
index 0000000..5d84363
--- /dev/null
+++ b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/css/site.css
@@ -0,0 +1,86 @@
+#blazor-error-ui {
+ background: lightyellow;
+ bottom: 0;
+ box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
+ display: none;
+ left: 0;
+ padding: 0.6rem 1.25rem 0.7rem 1.25rem;
+ position: fixed;
+ width: 100%;
+ z-index: 1000;
+}
+
+#blazor-error-ui .dismiss {
+ cursor: pointer;
+ position: absolute;
+ right: 0.75rem;
+ top: 0.5rem;
+}
+
+:root {
+ font-size: var(--rz-root-font-size);
+}
+
+body {
+ font-family: var(--rz-text-font-family);
+ color: var(--rz-text-color);
+ font-size: var(--rz-body-font-size);
+ line-height: var(--rz-body-line-height);
+ background-color: var(--rz-body-background-color);
+}
+
+.rz-body {
+ --rz-body-padding: 0;
+}
+
+a {
+ color: var(--rz-link-color);
+}
+
+a:hover,
+a:focus {
+ color: var(--rz-link-hover-color);
+}
+
+.blazor-error-boundary {
+ background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
+ padding: 1rem 1rem 1rem 3.7rem;
+ color: white;
+}
+
+.blazor-error-boundary::after {
+ content: "An error has occurred."
+}
+
+.loading-progress {
+ position: relative;
+ display: block;
+ width: 8rem;
+ height: 8rem;
+ margin: 20vh auto 1rem auto;
+}
+
+.loading-progress circle {
+ fill: none;
+ stroke: #e0e0e0;
+ stroke-width: 0.6rem;
+ transform-origin: 50% 50%;
+ transform: rotate(-90deg);
+}
+
+.loading-progress circle:last-child {
+ stroke: #1b6ec2;
+ stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
+ transition: stroke-dasharray 0.05s ease-in-out;
+}
+
+.loading-progress-text {
+ position: absolute;
+ text-align: center;
+ font-weight: bold;
+ inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
+}
+
+.loading-progress-text:after {
+ content: var(--blazor-load-percentage-text, "Loading");
+}
\ No newline at end of file
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/favicon.ico b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/favicon.ico
new file mode 100644
index 0000000..e1f238a
Binary files /dev/null and b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/favicon.ico differ
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/login.jpg b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/login.jpg
new file mode 100644
index 0000000..88d9bc8
Binary files /dev/null and b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/login.jpg differ
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo-login.png b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo-login.png
new file mode 100644
index 0000000..d642f52
Binary files /dev/null and b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo-login.png differ
diff --git a/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo.png b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo.png
new file mode 100644
index 0000000..d8f0b6c
Binary files /dev/null and b/src/BlazorAppRadzenNet8UpgradeRadzen4to5/BlazorAppRadzenNet8UpgradeRadzen4to5/wwwroot/images/logo.png differ