Skip to content

Commit

Permalink
Merge pull request #62 from Tynab/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Tynab authored Jan 17, 2024
2 parents c2b7b8e + fb8b3ac commit c9a30c7
Show file tree
Hide file tree
Showing 60 changed files with 445 additions and 953 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ PM> NuGet\Install-Package Tynab.YANLib
```

### EXTENSION
- Numeric
- Text
- Bool
- Bytes
- DateTime
- Nullable
- Model
- JSON
- Enum
- Enumerable
- Random
- JSON
- Numeric
- Text
- Object
- Nullable
- Process
- Random
- Task
- Bytes

### OTHER
- Password

[See wiki for more details](https://github.com/Tynab/YANLib/wiki)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using YANLib.Benchmarks.Models;
using BenchmarkDotNet.Attributes;
using YANLib.Benchmarks.Models;
using static System.Guid;
using static System.Threading.Tasks.Parallel;

namespace YANLib.Benchmarks.Process.Common;

Expand Down
4 changes: 3 additions & 1 deletion console/YANLib.Benchmarks/Process/Common/HttpBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace YANLib.Benchmarks.Process.Common;
using BenchmarkDotNet.Attributes;

namespace YANLib.Benchmarks.Process.Common;

public class HttpBenchmark
{
Expand Down
5 changes: 4 additions & 1 deletion console/YANLib.Benchmarks/Process/Common/LoopBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace YANLib.Benchmarks.Process.Common;
using BenchmarkDotNet.Attributes;
using static System.Runtime.InteropServices.CollectionsMarshal;

namespace YANLib.Benchmarks.Process.Common;

public class LoopBenchmark
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using YANLib.Benchmarks.Models;
using BenchmarkDotNet.Attributes;
using YANLib.Benchmarks.Models;
using YANLib.Core;
using static Newtonsoft.Json.JsonConvert;
using static System.Guid;
using static System.Threading.Tasks.Parallel;

namespace YANLib.Benchmarks.Process.Library;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using YANLib.Benchmarks.Models;
using BenchmarkDotNet.Attributes;
using YANLib.Benchmarks.Models;
using YANLib.Core;
using static Newtonsoft.Json.JsonConvert;
using static System.Guid;
using static System.Threading.Tasks.Parallel;

namespace YANLib.Benchmarks.Process.Library;

Expand Down
4 changes: 4 additions & 0 deletions console/YANLib.Benchmarks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@
}
#endif

#if DEBUG
using static System.Console;

_ = ReadLine();
#endif
5 changes: 4 additions & 1 deletion host/YANLib.HttpApi.Host/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace YANLib.Controllers;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;

namespace YANLib.Controllers;

public class HomeController : AbpController
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace YANLib.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace YANLib.EntityFrameworkCore;

public class YANLibHttpApiHostMigrationsDbContext(DbContextOptions<YANLibHttpApiHostMigrationsDbContext> options) : AbpDbContext<YANLibHttpApiHostMigrationsDbContext>(options)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
namespace YANLib.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;
using static System.IO.Directory;

namespace YANLib.EntityFrameworkCore;

public class YANLibHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory<YANLibHttpApiHostMigrationsDbContext>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
namespace YANLib.Middlewares;
using Microsoft.AspNetCore.Http;
using System;
using System.IO;
using System.Threading.Tasks;
using YANLib.Core;
using static Microsoft.AspNetCore.Http.StatusCodes;
using static Serilog.Log;
using static System.Net.HttpStatusCode;

namespace YANLib.Middlewares;

public class UnauthorizedHandlerMiddleware(RequestDelegate next)
{
Expand Down
10 changes: 9 additions & 1 deletion host/YANLib.HttpApi.Host/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
namespace YANLib;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using System;
using System.Threading.Tasks;
using static Microsoft.AspNetCore.Builder.WebApplication;

namespace YANLib;

public class Program
{
Expand Down
5 changes: 4 additions & 1 deletion host/YANLib.HttpApi.Host/YANLibBrandingProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace YANLib;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;

namespace YANLib;

[Dependency(ReplaceServices = true)]
public class YANLibBrandingProvider : DefaultBrandingProvider
Expand Down
56 changes: 51 additions & 5 deletions host/YANLib.HttpApi.Host/YANLibHttpApiHostModule.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@

#if !DEBUG
using DotNetCore.CAP;
using Elastic.Apm.DiagnosticSource;
using Elastic.Apm.EntityFrameworkCore;
using Elastic.Apm.NetCoreAll;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.EventBus.Azure;
using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.Http.Client;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Swashbuckle;
using YANLib.Core;
using YANLib.EntityFrameworkCore;
using YANLib.Utilities;
using static Elastic.Apm.Agent;
using static HealthChecks.UI.Client.UIResponseWriter;
using static Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerDefaults;
using static Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus;
using static System.Convert;
using static System.StringSplitOptions;

#if DEBUG
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Http;
using YANLib.Middlewares;
using static Microsoft.OpenApi.Models.ParameterLocation;
using static Microsoft.OpenApi.Models.SecuritySchemeType;
using static System.Net.HttpStatusCode;
using static System.Threading.Tasks.Task;
#endif

namespace YANLib;
Expand Down Expand Up @@ -75,7 +121,7 @@ private static void ConfigureAuthentication(ServiceConfigurationContext context,
o.RequireHttpsMetadata = ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]);
o.Audience = configuration["AuthServer:ApiName"];

#if !DEBUG
#if DEBUG
o.Events = new JwtBearerEvents
{
OnMessageReceived = async c =>
Expand Down Expand Up @@ -119,7 +165,7 @@ private static void ConfigureSwaggerServices(ServiceConfigurationContext context
Version = "test"
});

#if !DEBUG
#if DEBUG
o.AddSecurityDefinition("Authorization", new OpenApiSecurityScheme
{
In = Header,
Expand Down Expand Up @@ -249,7 +295,7 @@ public override void OnApplicationInitialization(ApplicationInitializationContex

_ = app.UseCapDashboard();

#if !DEBUG
#if DEBUG
_ = app.UseMiddleware<UnauthorizedHandlerMiddleware>();
#endif

Expand Down
6 changes: 3 additions & 3 deletions lib/YANLib/YANLib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>ic.ico</ApplicationIcon>
Expand All @@ -18,11 +18,11 @@
<PackAsTool>False</PackAsTool>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<PackageReleaseNotes>Hotfix Enumerable</PackageReleaseNotes>
<PackageReleaseNotes>Upgrade all</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<PackageId>Tynab.YANLib</PackageId>
<Version>3.2.3</Version>
<Version>4.0.0</Version>
<LangVersion>preview</LangVersion>
</PropertyGroup>

Expand Down
132 changes: 0 additions & 132 deletions lib/YANLib/YANPass.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace YANLib.Application.Redis.ConnectionFactory;
using StackExchange.Redis;

namespace YANLib.Application.Redis.ConnectionFactory;

public interface IRedisConnectionFactory
{
Expand Down
Loading

0 comments on commit c9a30c7

Please sign in to comment.