-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
4 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
33 changes: 33 additions & 0 deletions
33
...binedSln/FairPlayCombined.DataAccess/Models/FairPlayTube/VideoIndexerSupportedLanguage.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated> | ||
#nullable disable | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using Microsoft.EntityFrameworkCore; | ||
using FairPlayCombined.DataAccess.Models.dboSchema; | ||
using FairPlayCombined.DataAccess.Models.FairPlayBudgetSchema; | ||
using FairPlayCombined.DataAccess.Models.FairPlayDatingSchema; | ||
using FairPlayCombined.DataAccess.Models.FairPlayShopSchema; | ||
using FairPlayCombined.DataAccess.Models.FairPlaySocialSchema; | ||
using FairPlayCombined.DataAccess.Models.FairPlayTubeSchema; | ||
|
||
|
||
namespace FairPlayCombined.DataAccess.Models.FairPlayTubeSchema; | ||
|
||
[Table("VideoIndexerSupportedLanguage", Schema = "FairPlayTube")] | ||
[Index("LanguageCode", Name = "UI_VideoIndexerSupportedLanguage_LanguageCode", IsUnique = true)] | ||
[Index("Name", Name = "UI_VideoIndexerSupportedLanguage_Name", IsUnique = true)] | ||
public partial class VideoIndexerSupportedLanguage | ||
{ | ||
[Key] | ||
public int VideoIndexerSupportedLanguageId { get; set; } | ||
|
||
[Required] | ||
[StringLength(50)] | ||
public string Name { get; set; } | ||
|
||
[Required] | ||
[StringLength(10)] | ||
public string LanguageCode { get; set; } | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/FairPlayCombinedSln/FairPlayCombined.Services/FairPlayTube/SupportedLanguageService.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using FairPlayCombined.DataAccess.Data; | ||
using FairPlayCombined.Models.AzureVideoIndexer; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Logging; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FairPlayCombined.Services.FairPlayTube | ||
{ | ||
public partial class SupportedLanguageService( | ||
IDbContextFactory<FairPlayCombinedDbContext> dbContextFactory, | ||
ILogger<SupportedLanguageService> logger) : BaseService | ||
{ | ||
public async Task<SupportedLanguageModel[]?> GetAllSupportedLanguageAsync( | ||
CancellationToken cancellationToken) | ||
{ | ||
logger.LogInformation(message: "Start of method: {methodName}", nameof(GetAllSupportedLanguageAsync)); | ||
var dbContext = await dbContextFactory.CreateDbContextAsync(cancellationToken); | ||
var result = await dbContext.VideoIndexerSupportedLanguage | ||
.Select(p => new SupportedLanguageModel | ||
{ | ||
name = p.Name, | ||
languageCode = p.LanguageCode | ||
}) | ||
.ToArrayAsync(cancellationToken: cancellationToken); | ||
return result; | ||
} | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...rPlayCombinedSln/FairPlayCombinedDb/FairPlayTube/Tables/VideoIndexerSupportedLanguage.sql
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,14 @@ | ||
CREATE TABLE [FairPlayTube].[VideoIndexerSupportedLanguage] | ||
( | ||
[VideoIndexerSupportedLanguageId] INT NOT NULL CONSTRAINT PK_VideoIndexerSupportedLanguage PRIMARY KEY IDENTITY, | ||
[Name] NVARCHAR(50) NOT NULL, | ||
[LanguageCode] NVARCHAR(10) NOT NULL | ||
) | ||
|
||
GO | ||
|
||
CREATE UNIQUE INDEX [UI_VideoIndexerSupportedLanguage_Name] ON [FairPlayTube].[VideoIndexerSupportedLanguage] ([Name]) | ||
|
||
GO | ||
|
||
CREATE UNIQUE INDEX [UI_VideoIndexerSupportedLanguage_LanguageCode] ON [FairPlayTube].[VideoIndexerSupportedLanguage] ([LanguageCode]) |
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