Skip to content

Commit

Permalink
Merge pull request #25 from pticostaricags/dev-aspire-prev4
Browse files Browse the repository at this point in the history
merge "dev-aspire-prev4" into "development"
  • Loading branch information
efonsecab committed Apr 22, 2024
2 parents 8406bba + 72c6db4 commit bf608e6
Show file tree
Hide file tree
Showing 41 changed files with 122 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@
<None Remove="Resources\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.1.23557.2" />
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24218.6" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.5.1-preview.24080.3" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.5.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.5.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24217.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.4.24217.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.2.24128.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayCombined.Common\FairPlayCombined.Common.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/FairPlayCombinedSln/FairPlayAdminPortal/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
.AddDefaultTokenProviders();

builder.Services.AddTransient<IUserProviderService, UserProviderService>();
builder.AddSqlServerDbContext<FairPlayCombinedDbContext>(connectionName: "FairPlayCombinedDb");
builder.Services.AddTransient<DbContextOptions<FairPlayCombinedDbContext>>(sp =>
{
IUserProviderService userProviderService = sp.GetRequiredService<IUserProviderService>();
Expand All @@ -67,7 +68,6 @@
});
return optionsBuilder.Options;
});
builder.AddSqlServerDbContext<FairPlayCombinedDbContext>(connectionName: "FairPlayCombinedDb");
builder.Services.AddDbContextFactory<FairPlayCombinedDbContext>();

builder.Services.AddMemoryCache();
Expand Down
15 changes: 9 additions & 6 deletions src/FairPlayCombinedSln/FairPlayBudget/FairPlayBudget.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
<Configurations>Debug;Release;Debug_Enable_Paid_Tests</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.1.23557.2" />
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24218.6" />
<PackageReference Include="Blazored.Toast" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24217.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.4.24217.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayCombined.Common\FairPlayCombined.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Testcontainers.MsSql" Version="3.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0-preview.2.24128.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0-preview.4.24219.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayCombined.Services.AI\FairPlayCombined.Services.AI.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
if (_logger.IsEnabled(LogLevel.Information))
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
_logger.LogInformation("Worker running at: {Time}", DateTimeOffset.Now);
}
await Task.Delay(1000, stoppingToken);
}
_logger.LogInformation("Worker finished at: {time}", DateTimeOffset.Now);
_logger.LogInformation("Worker finished at: {Time}", DateTimeOffset.Now);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.2.24128.5" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.4.24219.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayCombinedSln.ServiceDefaults\FairPlayCombinedSln.ServiceDefaults.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="9.0.0-preview.4.24219.8" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="9.0.0-preview.4.24219.8" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="9.0.0-preview.2.24128.4" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.1.88495">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24217.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="9.0.0-preview.4.24217.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<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 @@ -11,8 +11,8 @@
<None Include="..\FairPlayCombinedDb\Scripts\1-Script.PostDeployment1.sql" Link="1-Script.PostDeployment1.sql" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-preview.1.23557.2" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.4.24218.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.4.24219.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayCombined.DataAccess\FairPlayCombined.DataAccess.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class FairPlayCombinedDbInitializer(ILogger<FairPlayCombinedDbInitializer
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
logger.LogInformation("Start of method: {methodName}", nameof(ExecuteAsync));
logger.LogInformation("Start of method: {MethodName}", nameof(ExecuteAsync));
var scope = serviceProvider.CreateScope();
var dbContext = scope.ServiceProvider.GetRequiredService<FairPlayCombinedDbContext>();
var strategy = dbContext.Database.CreateExecutionStrategy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<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 @@ -7,7 +7,7 @@
<Configurations>Debug;Release;Debug_Enable_Paid_Tests</Configurations>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.4.24219.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FairPlayAdminPortal\FairPlayAdminPortal.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="8.0.0" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite" Version="9.0.0-preview.4.24217.1" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<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 @@ -28,7 +28,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.23472.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" PrivateAssets="all" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<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 @@ -113,7 +113,7 @@ public partial class {{symbol.Name}}(
CancellationToken cancellationToken
)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(Create{{entityName}}Async));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(Create{{entityName}}Async));
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
{{entityName}} entity = new()
{
Expand All @@ -127,7 +127,7 @@ CancellationToken cancellationToken
public async Task<{{listActivityModel.Name}}[]> GetAll{{entityName}}Async(
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetAll{{entityName}}Async));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetAll{{entityName}}Async));
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
var result = await dbContext.{{entityName}}
.AsNoTracking()
Expand Down Expand Up @@ -169,7 +169,7 @@ await dbContext.{{entityName}}
CancellationToken cancellationToken
)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetPaginated{{entityName}}Async));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetPaginated{{entityName}}Async));
{{paginationResultArgument.Name}}<{{listActivityModel.Name}}> result=new();
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
string orderByString = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<Plan> CreatePlan()
planCreateRequest.RequestBody(plan);
var response = await httpClient!.Execute(planCreateRequest);
var planResult = response.Result<Plan>();
logger.LogInformation(message: "Plan created: {planInfo}", planResult!.ToString());
logger.LogInformation(message: "Plan created: {PlanInfo}", planResult!.ToString());
return planResult;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace FairPlayCombined.Services.Common
{
public class PayPalService(PayPalHttpClient httpClient, ILogger<PayPalService> logger) : IPayPalService
{
public async Task<CreatePayoutResponse> CreatePayoutAsync(
public async Task<CreatePayoutResponse?> CreatePayoutAsync(
string emailMessage,
string emailSubject,
string receiverEmailAddress,
Expand Down Expand Up @@ -42,9 +42,9 @@ public async Task<CreatePayoutResponse> CreatePayoutAsync(
}
catch (Exception ex)
{
logger.LogError(exception: ex, message: "Exception occurred in {methodName}. " +
"Message: {message}", nameof(CreatePayoutAsync), ex.Message);
throw;
logger.LogError(exception: ex, message: "Exception occurred in {MethodName}. " +
"Message: {Message}", nameof(CreatePayoutAsync), ex.Message);
return null;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class PromptGeneratorService(IDbContextFactory<FairPlayCombinedDbContext>
public async Task<PromptModel?> GetPromptCompleteInfoAsync(string promptName,
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetPromptCompleteInfoAsync));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetPromptCompleteInfoAsync));
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken: cancellationToken);
var result = await dbContext.Prompt.Include(p=>p.PromptVariable)
.Where(p=>p.PromptName == promptName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PackageReference Include="Microsoft.Azure.CognitiveServices.ContentModerator" Version="2.0.0" />
<PackageReference Include="PayoutsSdk" Version="1.1.1" />
<PackageReference Include="PayPal" Version="2.0.0-rc2" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.23.2.88755">
<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 @@ -17,7 +17,7 @@ public partial class SupportedLanguageService(
public async Task<SupportedLanguageModel[]?> GetAllSupportedLanguageAsync(
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetAllSupportedLanguageAsync));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetAllSupportedLanguageAsync));
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
var result = await dbContext.VideoIndexerSupportedLanguage
.Select(p => new SupportedLanguageModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task<PaginationOfT<VideoInfoModel>> GetPaginatedCompletedVideoInfob
string userId,
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetPaginatedCompletedVideoInfobyUserIdAsync));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetPaginatedCompletedVideoInfobyUserIdAsync));
PaginationOfT<VideoInfoModel> result = new();
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
string orderByString = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class VideoPlanService : BaseService
public async Task UpdateVideoPlanAsync(UpdateVideoPlanModel createModel,
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(UpdateVideoPlanAsync));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(UpdateVideoPlanAsync));
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
VideoPlan entity = await dbContext.VideoPlan
.SingleAsync(p=>p.VideoPlanId == createModel.VideoPlanId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task<PaginationOfT<VideoThumbnailModel>>
PaginationRequest paginationRequest,
CancellationToken cancellationToken)
{
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetPaginatedVideoThumbnailAsync));
logger.LogInformation(message: "Start of method: {MethodName}", nameof(GetPaginatedVideoThumbnailAsync));
PaginationOfT<VideoThumbnailModel> result = new();
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken);
string orderByString = string.Empty;
Expand Down
Loading

0 comments on commit bf608e6

Please sign in to comment.