Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Sync master #53

Merged
merged 15 commits into from
Oct 22, 2023
Binary file modified Script.sql
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ protected BaseEntity()

[Key]
public string Id { get; set; }
public bool IsDelete { get; set; } = false;
public string? CreatedBy { get; set; }
public string? LastUpdatedBy { get; set; }
//public string? DeletedBy { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11"></PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.12"></PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.12">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public interface IIdentityService : IBaseIdentityService

public Task<IList<Claim>> GetClaimsAsync(ApplicationUser user);
public Task SetVerfiedEmailAsync(ApplicationUser user, string email);
public Task<int> SetWalletAsync(ApplicationUser user, string walletId);
public Task SetUserAvatarUrlAsync(ApplicationUser identity, string photoUrl);
}
7 changes: 7 additions & 0 deletions src/SWD-Laundry-Backend.Core/Models/LoginModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace SWD_Laundry_Backend.Core.Models;
public readonly struct LoginModel
{
public string? AccessToken { get; init; }
public string? UserName { get; init; }
public string? Password { get; init; }
}
5 changes: 1 addition & 4 deletions src/SWD-Laundry-Backend.Core/Models/PaymentModel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using StackExchange.Redis;
using System.ComponentModel.DataAnnotations.Schema;

namespace SWD_Laundry_Backend.Core.Models;
namespace SWD_Laundry_Backend.Core.Models;

public class PaymentModel
{
Expand Down
2 changes: 2 additions & 0 deletions src/SWD-Laundry-Backend.Core/QueryObject/BaseQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ public record class BaseQuery
public DateTime? EndDate { get; init; }
[BindProperty(Name = "sort", SupportsGet = true)]
public string? Sort { get; init; }
[BindProperty(Name = "is-deleted", SupportsGet = true)]
public bool IsDeleted { get; init; } = false;
}
8 changes: 4 additions & 4 deletions src/SWD-Laundry-Backend.Core/SWD-Laundry-Backend.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FirebaseAdmin" Version="2.4.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.7.1" />
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.8.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Invedia.DI" Version="2021.7.22.1" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.11" />
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.12" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.0-rc.1.23421.29" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
5 changes: 4 additions & 1 deletion src/SWD-Laundry-Backend.Repository/Base/BaseRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public virtual async Task<T> AddAsync(T entity, CancellationToken cancellationTo

public virtual async Task<int> DeleteAsync(Expression<Func<T, bool>> filter, CancellationToken cancellationToken = default)
{
var i = await DbSet.Where(filter).ExecuteDeleteAsync(cancellationToken);
//var i = await DbSet.Where(filter).ExecuteDeleteAsync(cancellationToken);
var i = await DbSet.Where(filter)
.ExecuteUpdateAsync(x => x.SetProperty(x => x.IsDelete, true)
, cancellationToken);
return i;
}

Expand Down
Loading
Loading