-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from neozhu/dev
migrate from dev
- Loading branch information
Showing
89 changed files
with
3,039 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,3 +348,6 @@ MigrationBackup/ | |
|
||
# Ionide (cross platform F# VS Code tools) working folder | ||
.ionide/ | ||
|
||
|
||
**/Files/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
# CleanArchitectureWithBlazorServer | ||
This is a repository for creating a Blazor Server application following the principles of Clean Architecture | ||
## Live Demo | ||
- Blazor webassembly mode: https://mudblazor.dotnet6.cn/ | ||
- Blazor Server mode: https://mudblazor-s.dotnet6.cn/ | ||
## Screenshots | ||
![doc/login_screenshot.png](doc/login_screenshot.png) | ||
![doc/main_screenshot.png](doc/main_screenshot.png) | ||
## Screenshots and video | ||
![doc/main_screenshot.png](doc/main_screenshot.png) | ||
|
||
## Development Enviroment | ||
- Microsoft Visual Studio Community 2022 (64-bit) | ||
- Docker | ||
- .NET 6.0 | ||
## Code generation | ||
- CleanArchitectureCodeGenerator | ||
- https://github.com/neozhu/CleanArchitectureCodeGenerator | ||
## Why develop with blazor server mode | ||
- Develop fast | ||
- Runing fast | ||
- Most simple | ||
|
||
## Characteristic | ||
- Clean principles | ||
- Simple principles | ||
- Easy to start with | ||
|
||
## About | ||
Coming up. | ||
|
||
|
||
|
||
## License | ||
Apache 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace CleanArchitecture.Blazor.Application.Common.Models; | ||
|
||
public partial class PaginationFilter : BaseFilter | ||
{ | ||
public int PageNumber { get; set; } | ||
public int PageSize { get; set; } | ||
public string OrderBy { get; set; } | ||
public string SortDirection { get; set; } | ||
} | ||
|
||
public class BaseFilter | ||
{ | ||
public Search AdvancedSearch { get; set; } | ||
|
||
public string Keyword { get; set; } | ||
} | ||
|
||
public partial class Search | ||
{ | ||
public ICollection<string> Fields { get; set; } | ||
public string Keyword { get; set; } | ||
|
||
} |
57 changes: 0 additions & 57 deletions
57
src/Application/Features/Products/Commands/AcceptChanges/AcceptChangesProductCommand.cs
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...lication/Features/Products/Commands/AcceptChanges/AcceptChangesProductCommandValidator.cs
This file was deleted.
Oops, something went wrong.
33 changes: 23 additions & 10 deletions
33
src/Application/Features/Products/Commands/AddEdit/AddEditProductCommandValidator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace CleanArchitecture.Blazor.Application.Features.Products.Commands.AddEdit; | ||
|
||
public class AddEditProductCommandValidator : AbstractValidator<AddEditProductCommand> | ||
public class AddEditProductCommandValidator : AbstractValidator<AddEditProductCommand> | ||
{ | ||
public AddEditProductCommandValidator() | ||
{ | ||
public AddEditProductCommandValidator() | ||
{ | ||
//TODO:Implementing AddEditProductCommandValidator method | ||
//ex. RuleFor(v => v.Name) | ||
// .MaximumLength(256) | ||
// .NotEmpty(); | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
RuleFor(v => v.Name) | ||
.MaximumLength(256) | ||
.NotEmpty(); | ||
RuleFor(v => v.Unit) | ||
.MaximumLength(2) | ||
.NotEmpty(); | ||
RuleFor(v => v.Price) | ||
.GreaterThanOrEqualTo(0); | ||
|
||
} | ||
|
||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) => | ||
{ | ||
var result = await ValidateAsync(ValidationContext<AddEditProductCommand>.CreateWithOptions((AddEditProductCommand)model, x => x.IncludeProperties(propertyName))); | ||
if (result.IsValid) | ||
return Array.Empty<string>(); | ||
return result.Errors.Select(e => e.ErrorMessage); | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.