Skip to content

Commit 8579c70

Browse files
committed
2 parents cdfacd2 + c58ab4b commit 8579c70

50 files changed

Lines changed: 209 additions & 20 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BlazorHero.CleanArchitecture.Application/Features/Brands/AddEdit/AddEditBrandCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public async Task<Result<int>> Handle(AddEditBrandCommand command, CancellationT
3434
{
3535
await _unitOfWork.Repository<Brand>().AddAsync(brand);
3636
await _unitOfWork.Commit(cancellationToken);
37-
return Result<int>.Success(brand.Id, "Brand Saved!");
37+
return Result<int>.Success(brand.Id, "Brand Saved");
3838
}
3939
else
4040
{
4141
await _unitOfWork.Repository<Brand>().UpdateAsync(brand);
4242
await _unitOfWork.Commit(cancellationToken);
43-
return Result<int>.Success(brand.Id, "Brand Updated!");
43+
return Result<int>.Success(brand.Id, "Brand Updated");
4444
}
4545
}
4646
}

BlazorHero.CleanArchitecture.Application/Features/Brands/Delete/DeleteBrandCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public async Task<Result<int>> Handle(DeleteBrandCommand command, CancellationTo
3030
var brand = await _unitOfWork.Repository<Brand>().GetByIdAsync(command.Id);
3131
await _unitOfWork.Repository<Brand>().DeleteAsync(brand);
3232
await _unitOfWork.Commit(cancellationToken);
33-
return Result<int>.Success(brand.Id, "Brand Deleted!");
33+
return Result<int>.Success(brand.Id, "Brand Deleted");
3434
}
3535
else
3636
{
37-
return Result<int>.Fail("Deletion Not Allowed!");
37+
return Result<int>.Fail("Deletion Not Allowed");
3838
}
3939
}
4040
}

BlazorHero.CleanArchitecture.Application/Features/Products/Commands/AddEdit/AddEditProductCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public async Task<Result<int>> Handle(AddEditProductCommand command, Cancellatio
3737
{
3838
await _unitOfWork.Repository<Product>().AddAsync(product);
3939
await _unitOfWork.Commit(cancellationToken);
40-
return Result<int>.Success(product.Id, "Product Saved!");
40+
return Result<int>.Success(product.Id, "Product Saved");
4141
}
4242
else
4343
{
4444
await _unitOfWork.Repository<Product>().UpdateAsync(product);
4545
await _unitOfWork.Commit(cancellationToken);
46-
return Result<int>.Success(product.Id, "Product Updated!");
46+
return Result<int>.Success(product.Id, "Product Updated");
4747
}
4848
}
4949
}

BlazorHero.CleanArchitecture.Application/Features/Products/Commands/Delete/DeleteProductCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task<Result<int>> Handle(DeleteProductCommand command, Cancellation
2525
var product = await _unitOfWork.Repository<Product>().GetByIdAsync(command.Id);
2626
await _unitOfWork.Repository<Product>().DeleteAsync(product);
2727
await _unitOfWork.Commit(cancellationToken);
28-
return Result<int>.Success(product.Id, "Product Deleted!");
28+
return Result<int>.Success(product.Id, "Product Deleted");
2929
}
3030
}
3131
}

BlazorHero.CleanArchitecture.Infrastructure/Services/Identity/RoleService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public async Task<Result<string>> SaveAsync(RoleRequest request)
115115
var existingRole = await _roleManager.FindByNameAsync(request.Name);
116116
if (existingRole != null) return Result<string>.Fail($"Similar Role already exists.");
117117
var response = await _roleManager.CreateAsync(new IdentityRole(request.Name));
118-
return Result<string>.Success("Role Created.");
118+
return Result<string>.Success("Role Created");
119119
}
120120
else
121121
{

BlazorHero.CleanArchitecture.Infrastructure/Services/Identity/UserService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public async Task<IResult> RegisterAsync(RegisterRequest request, string origin)
7373
var verificationUri = await SendVerificationEmail(user, origin);
7474
//TODO: Attach Email Service here and configure it via appsettings
7575
BackgroundJob.Enqueue(() => _mailService.SendAsync(new MailRequest() { From = "mail@codewithmukesh.com", To = user.Email, Body = $"Please confirm your account by <a href='{verificationUri}'>clicking here</a>.", Subject = "Confirm Registration" }));
76-
return Result<string>.Success(user.Id, message: $"User Registered. Confirmation Mail has been delivered to the Mailbox.");
76+
return Result<string>.Success(user.Id, message: $"User Registered Mailbox");
7777
}
78-
return Result<string>.Success(user.Id, message: $"User Registered!");
78+
return Result<string>.Success(user.Id, message: $"User Registered");
7979
}
8080
else
8181
{
@@ -153,7 +153,7 @@ public async Task<IResult> UpdateRolesAsync(UpdateUserRolesRequest request)
153153
var roles = await _userManager.GetRolesAsync(user);
154154
var result = await _userManager.RemoveFromRolesAsync(user, roles);
155155
result = await _userManager.AddToRolesAsync(user, request.UserRoles.Where(x => x.Selected).Select(y => y.RoleName));
156-
return Result.Success("Roles Updated.");
156+
return Result.Success("Roles Updated");
157157
}
158158

159159
public async Task<IResult<string>> ConfirmEmailAsync(string userId, string code)

BlazorHero.CleanArchitecture/Client/Pages/Catalog/AddEditBrandModal.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private async Task SaveAsync()
4343
var response = await _brandManager.SaveAsync(request);
4444
if (response.Succeeded)
4545
{
46-
_snackBar.Add(response.Messages[0], Severity.Success);
46+
_snackBar.Add(localizer[response.Messages[0]], Severity.Success);
4747
MudDialog.Close();
4848
}
4949
else

BlazorHero.CleanArchitecture/Client/Pages/Catalog/AddEditProductModal.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private async Task SaveAsync()
6666
var response = await _productManager.SaveAsync(request);
6767
if (response.Succeeded)
6868
{
69-
_snackBar.Add(response.Messages[0], Severity.Success);
69+
_snackBar.Add(localizer[response.Messages[0]], Severity.Success);
7070
MudDialog.Close();
7171
}
7272
else

BlazorHero.CleanArchitecture/Client/Pages/Catalog/Brands.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private async Task Delete(int id)
4646
if (response.Succeeded)
4747
{
4848
await Reset();
49-
_snackBar.Add(response.Messages[0], Severity.Success);
49+
_snackBar.Add(localizer[response.Messages[0]], Severity.Success);
5050
}
5151
else
5252
{

BlazorHero.CleanArchitecture/Client/Pages/Identity/RegisterUserModal.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private async Task SaveAsync()
7272
var response = await _userManager.RegisterUserAsync(request);
7373
if (response.Succeeded)
7474
{
75-
_snackBar.Add(response.Messages[0], Severity.Success);
75+
_snackBar.Add(localizer[response.Messages[0]], Severity.Success);
7676
MudDialog.Close();
7777
}
7878
else

0 commit comments

Comments
 (0)