diff --git a/.gitignore b/.gitignore
index 114d915..c7ac18e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,11 @@
-.agents/
-.codex/
.vs/
bin/
-Binaries
-Intermediate/
obj/
+releases/*
+!releases/.gitkeep
.DS_Store
.env
*.filters
*.user
-*.lscache
desktop.ini
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 7cb3a8d..7def927 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -16,6 +16,7 @@ src/Tribufu/Client/OpenAPIDateConverter.cs
src/Tribufu/Client/RequestOptions.cs
src/Tribufu/Client/RetryConfiguration.cs
src/Tribufu/Model/AbstractOpenAPISchema.cs
+src/Tribufu/Model/Account.cs
src/Tribufu/Model/Application.cs
src/Tribufu/Model/ApplicationType.cs
src/Tribufu/Model/AuthorizeRequest.cs
@@ -25,7 +26,7 @@ src/Tribufu/Model/CodeChallengeMethod.cs
src/Tribufu/Model/CodeResponse.cs
src/Tribufu/Model/CreateUser.cs
src/Tribufu/Model/CryptoViewModel.cs
-src/Tribufu/Model/ExternalAccount.cs
+src/Tribufu/Model/File.cs
src/Tribufu/Model/Game.cs
src/Tribufu/Model/GameServer.cs
src/Tribufu/Model/GameServerCluster.cs
@@ -33,22 +34,19 @@ src/Tribufu/Model/GameServerQuery.cs
src/Tribufu/Model/GameServerStatus.cs
src/Tribufu/Model/GrantType.cs
src/Tribufu/Model/Group.cs
-src/Tribufu/Model/GroupApplication.cs
+src/Tribufu/Model/GroupGame.cs
src/Tribufu/Model/GroupMember.cs
src/Tribufu/Model/GroupRank.cs
src/Tribufu/Model/HashViewModel.cs
-src/Tribufu/Model/IdentityProviderType.cs
src/Tribufu/Model/IntrospectRequest.cs
src/Tribufu/Model/IntrospectResponse.cs
src/Tribufu/Model/IpAddress.cs
src/Tribufu/Model/LeaderboardItem.cs
src/Tribufu/Model/LeaderboardOrder.cs
+src/Tribufu/Model/LoginProvider.cs
src/Tribufu/Model/ModelClient.cs
src/Tribufu/Model/Package.cs
src/Tribufu/Model/PackageRelease.cs
-src/Tribufu/Model/Product.cs
-src/Tribufu/Model/ProductPrice.cs
-src/Tribufu/Model/ProductType.cs
src/Tribufu/Model/Profile.cs
src/Tribufu/Model/ProfileGame.cs
src/Tribufu/Model/ProfileGroup.cs
@@ -57,7 +55,8 @@ src/Tribufu/Model/RevokeRequest.cs
src/Tribufu/Model/Search.cs
src/Tribufu/Model/SearchType.cs
src/Tribufu/Model/ServerMetrics.cs
-src/Tribufu/Model/StorageFile.cs
+src/Tribufu/Model/Subscription.cs
+src/Tribufu/Model/SubscriptionPrice.cs
src/Tribufu/Model/TokenHintType.cs
src/Tribufu/Model/TokenRequest.cs
src/Tribufu/Model/TokenResponse.cs
diff --git a/Directory.Build.props b/Directory.Build.props
index 5e893d6..96c42d7 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -5,17 +5,9 @@
Copyright (c) Tribufu. All Rights Reserved.
MIT
git
- https://github.com/Tribufu/TribufuDotNet
- 1.3.0
+ https://github.com/tribufu/tribufu-dotnet
+ 1.2.0
$(Version).0
$(NoWarn);0618;1591;1998;2002;8767
-
- $(SolutionDir)Intermediate\DotNet\$(MSBuildProjectName)\
- $(BaseIntermediateOutputPath)$(Configuration)\
- $(BaseIntermediateOutputPath)
- $(IntermediateOutputPath)
- $(SolutionDir)Binaries\$(Configuration)\DotNet\
- $(SolutionDir)Intermediate\
-
diff --git a/README.md b/README.md
index a5bf230..1108fa0 100644
--- a/README.md
+++ b/README.md
@@ -6,10 +6,10 @@
[![MIT License][mit-badge]][mit-url]
[![Discord Chat][discord-badge]][discord-url]
-[nuget-badge]: https://img.shields.io/nuget/v/Tribufu.svg
+[nuget-badge]: https://img.shields.io/nuget/v/tribufu.svg
[nuget-url]: https://www.nuget.org/packages/Tribufu
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
-[mit-url]: https://github.com/Tribufu/TribufuDotNet/blob/main/LICENSE.txt
+[mit-url]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
[discord-url]: https://www.tribufu.com/discord
@@ -20,4 +20,4 @@
This project is licensed under the [MIT License].
-[MIT License]: https://github.com/Tribufu/TribufuDotNet/blob/main/LICENSE.txt
+[MIT License]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
diff --git a/Scripts/Package.ps1 b/Scripts/Package.ps1
deleted file mode 100644
index 658179e..0000000
--- a/Scripts/Package.ps1
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env pwsh
-
-Get-ChildItem ./Intermediate -Filter *.nupkg -Recurse -Force | Remove-Item -Force
-
-dotnet clean
-dotnet build -c Release
-dotnet pack -c Release -o ./Intermediate
diff --git a/Source/Tribufu/Model/ProductType.cs b/Source/Tribufu/Model/ProductType.cs
deleted file mode 100644
index a75e466..0000000
--- a/Source/Tribufu/Model/ProductType.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Tribufu API
- *
- * API to access Tribufu services.
- *
- * The version of the OpenAPI document: 1.4.3
- * Contact: contact@tribufu.com
- * Generated by: https://github.com/openapitools/openapi-generator.git
- */
-
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Text;
-using System.Text.RegularExpressions;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using Newtonsoft.Json.Linq;
-using System.ComponentModel.DataAnnotations;
-using OpenAPIDateConverter = Tribufu.Client.OpenAPIDateConverter;
-
-namespace Tribufu.Model
-{
- ///
- /// Defines ProductType
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public enum ProductType
- {
- ///
- /// Enum Product for value: product
- ///
- [EnumMember(Value = "product")]
- Product,
-
- ///
- /// Enum Subscription for value: subscription
- ///
- [EnumMember(Value = "subscription")]
- Subscription
- }
-
-}
diff --git a/Source/Tribufu/Model/Profile.cs b/Source/Tribufu/Model/Profile.cs
deleted file mode 100644
index 02724d5..0000000
--- a/Source/Tribufu/Model/Profile.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Tribufu API
- *
- * API to access Tribufu services.
- *
- * The version of the OpenAPI document: 1.4.3
- * Contact: contact@tribufu.com
- * Generated by: https://github.com/openapitools/openapi-generator.git
- */
-
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Text;
-using System.Text.RegularExpressions;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using Newtonsoft.Json.Linq;
-using System.ComponentModel.DataAnnotations;
-using OpenAPIDateConverter = Tribufu.Client.OpenAPIDateConverter;
-
-namespace Tribufu.Model
-{
- ///
- /// Profile
- ///
- [DataContract(Name = "Profile")]
- public partial class Profile : IValidatableObject
- {
- ///
- /// Initializes a new instance of the class.
- ///
- [JsonConstructorAttribute]
- public Profile()
- {
- }
-
- ///
- /// Gets or Sets Id
- ///
- [DataMember(Name = "id", EmitDefaultValue = false)]
- public string Id { get; private set; }
-
- ///
- /// Returns false as Id should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeId()
- {
- return false;
- }
- ///
- /// Gets or Sets Name
- ///
- [DataMember(Name = "name", EmitDefaultValue = true)]
- public string Name { get; private set; }
-
- ///
- /// Returns false as Name should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeName()
- {
- return false;
- }
- ///
- /// Gets or Sets DisplayName
- ///
- [DataMember(Name = "display_name", EmitDefaultValue = true)]
- public string DisplayName { get; private set; }
-
- ///
- /// Returns false as DisplayName should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeDisplayName()
- {
- return false;
- }
- ///
- /// Gets or Sets Level
- ///
- [DataMember(Name = "level", EmitDefaultValue = false)]
- public int Level { get; private set; }
-
- ///
- /// Returns false as Level should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeLevel()
- {
- return false;
- }
- ///
- /// Gets or Sets Experience
- ///
- [DataMember(Name = "experience", EmitDefaultValue = false)]
- public double Experience { get; private set; }
-
- ///
- /// Returns false as Experience should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeExperience()
- {
- return false;
- }
- ///
- /// Gets or Sets Birthday
- ///
- [DataMember(Name = "birthday", EmitDefaultValue = true)]
- [JsonConverter(typeof(OpenAPIDateConverter))]
- public DateTime? Birthday { get; private set; }
-
- ///
- /// Returns false as Birthday should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeBirthday()
- {
- return false;
- }
- ///
- /// Gets or Sets Points
- ///
- [DataMember(Name = "points", EmitDefaultValue = false)]
- public double Points { get; private set; }
-
- ///
- /// Returns false as Points should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializePoints()
- {
- return false;
- }
- ///
- /// Gets or Sets PhotoUrl
- ///
- [DataMember(Name = "photo_url", EmitDefaultValue = true)]
- public string PhotoUrl { get; private set; }
-
- ///
- /// Returns false as PhotoUrl should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializePhotoUrl()
- {
- return false;
- }
- ///
- /// Gets or Sets BannerUrl
- ///
- [DataMember(Name = "banner_url", EmitDefaultValue = true)]
- public string BannerUrl { get; private set; }
-
- ///
- /// Returns false as BannerUrl should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeBannerUrl()
- {
- return false;
- }
- ///
- /// Gets or Sets LastOnline
- ///
- [DataMember(Name = "last_online", EmitDefaultValue = true)]
- public DateTime? LastOnline { get; private set; }
-
- ///
- /// Returns false as LastOnline should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeLastOnline()
- {
- return false;
- }
- ///
- /// Gets or Sets Biography
- ///
- [DataMember(Name = "biography", EmitDefaultValue = true)]
- public string Biography { get; private set; }
-
- ///
- /// Returns false as Biography should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeBiography()
- {
- return false;
- }
- ///
- /// Gets or Sets CreatedAt
- ///
- [DataMember(Name = "created_at", EmitDefaultValue = false)]
- public DateTime CreatedAt { get; private set; }
-
- ///
- /// Returns false as CreatedAt should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeCreatedAt()
- {
- return false;
- }
- ///
- /// Gets or Sets UpdatedAt
- ///
- [DataMember(Name = "updated_at", EmitDefaultValue = true)]
- public DateTime? UpdatedAt { get; private set; }
-
- ///
- /// Returns false as UpdatedAt should not be serialized given that it's read-only.
- ///
- /// false (boolean)
- public bool ShouldSerializeUpdatedAt()
- {
- return false;
- }
- ///
- /// Returns the string presentation of the object
- ///
- /// String presentation of the object
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.Append("class Profile {\n");
- sb.Append(" Id: ").Append(Id).Append("\n");
- sb.Append(" Name: ").Append(Name).Append("\n");
- sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
- sb.Append(" Level: ").Append(Level).Append("\n");
- sb.Append(" Experience: ").Append(Experience).Append("\n");
- sb.Append(" Birthday: ").Append(Birthday).Append("\n");
- sb.Append(" Points: ").Append(Points).Append("\n");
- sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
- sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
- sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
- sb.Append(" Biography: ").Append(Biography).Append("\n");
- sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n");
- sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n");
- sb.Append("}\n");
- return sb.ToString();
- }
-
- ///
- /// Returns the JSON string presentation of the object
- ///
- /// JSON string presentation of the object
- public virtual string ToJson()
- {
- return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
- }
-
- ///
- /// To validate all properties of the instance
- ///
- /// Validation context
- /// Validation Result
- IEnumerable IValidatableObject.Validate(ValidationContext validationContext)
- {
- // DisplayName (string) maxLength
- if (this.DisplayName != null && this.DisplayName.Length > 45)
- {
- yield return new ValidationResult("Invalid value for DisplayName, length must be less than 45.", new [] { "DisplayName" });
- }
-
- // BannerUrl (string) maxLength
- if (this.BannerUrl != null && this.BannerUrl.Length > 255)
- {
- yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
- }
-
- yield break;
- }
- }
-
-}
diff --git a/Tribufu.sln b/Tribufu.sln
new file mode 100644
index 0000000..0f722d9
--- /dev/null
+++ b/Tribufu.sln
@@ -0,0 +1,144 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Example", "src\Tribufu.Example\Tribufu.Example.csproj", "{D6392A29-E2DC-4050-B4C1-B279DD2D226D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Logging", "src\Tribufu.Logging\Tribufu.Logging.csproj", "{CFD80847-9B98-4991-BADF-8714E7D8D81C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Configuration", "src\Tribufu.Configuration\Tribufu.Configuration.csproj", "{C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Platform", "src\Tribufu.Platform\Tribufu.Platform.csproj", "{26EEB407-733C-4383-9211-B083CD5F593B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.EntityFrameworkCore", "src\Tribufu.EntityFrameworkCore\Tribufu.EntityFrameworkCore.csproj", "{E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization", "src\Tribufu.Serialization\Tribufu.Serialization.csproj", "{D6DAE078-2F80-49DD-97A3-B1223FE04F91}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.ComponentModel", "src\Tribufu.ComponentModel\Tribufu.ComponentModel.csproj", "{7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.AspNetCore", "src\Tribufu.AspNetCore\Tribufu.AspNetCore.csproj", "{B6C47A6C-E389-4132-8E1C-0CBB6C96C205}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.Build.0 = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.Build.0 = Debug|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.ActiveCfg = Release|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.Build.0 = Release|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.ActiveCfg = Release|Any CPU
+ {7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.Build.0 = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.Build.0 = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.Build.0 = Debug|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.ActiveCfg = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.Build.0 = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.ActiveCfg = Release|Any CPU
+ {D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.Build.0 = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|x64.Build.0 = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Debug|x86.Build.0 = Debug|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|x64.ActiveCfg = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|x64.Build.0 = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|x86.ActiveCfg = Release|Any CPU
+ {CFD80847-9B98-4991-BADF-8714E7D8D81C}.Release|x86.Build.0 = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|x64.Build.0 = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Debug|x86.Build.0 = Debug|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|x64.ActiveCfg = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|x64.Build.0 = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|x86.ActiveCfg = Release|Any CPU
+ {C0A841C8-9FC5-4AC0-B9AD-6BBFCEDCBE5F}.Release|x86.Build.0 = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|x64.Build.0 = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Debug|x86.Build.0 = Debug|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|x64.ActiveCfg = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|x64.Build.0 = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|x86.ActiveCfg = Release|Any CPU
+ {26EEB407-733C-4383-9211-B083CD5F593B}.Release|x86.Build.0 = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|x64.Build.0 = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Debug|x86.Build.0 = Debug|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|x64.ActiveCfg = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|x64.Build.0 = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|x86.ActiveCfg = Release|Any CPU
+ {E7F9A76F-C087-410B-B4B5-A928A6CDC2BA}.Release|x86.Build.0 = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|x64.Build.0 = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Debug|x86.Build.0 = Debug|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|x64.ActiveCfg = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|x64.Build.0 = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|x86.ActiveCfg = Release|Any CPU
+ {D6DAE078-2F80-49DD-97A3-B1223FE04F91}.Release|x86.Build.0 = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|x64.Build.0 = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Debug|x86.Build.0 = Debug|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|x64.ActiveCfg = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|x64.Build.0 = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|x86.ActiveCfg = Release|Any CPU
+ {7CB04FFD-8F4B-4B40-BB4B-2BAA19D783E1}.Release|x86.Build.0 = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|x64.Build.0 = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Debug|x86.Build.0 = Debug|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|x64.ActiveCfg = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|x64.Build.0 = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|x86.ActiveCfg = Release|Any CPU
+ {B6C47A6C-E389-4132-8E1C-0CBB6C96C205}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/TribufuDotNet.slnx b/TribufuDotNet.slnx
deleted file mode 100644
index cb7cb6c..0000000
--- a/TribufuDotNet.slnx
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/releases/.gitkeep b/releases/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/Scripts/Generate.ps1 b/scripts/generate.ps1
similarity index 58%
rename from Scripts/Generate.ps1
rename to scripts/generate.ps1
index abb11fc..7f14cb8 100644
--- a/Scripts/Generate.ps1
+++ b/scripts/generate.ps1
@@ -1,7 +1,5 @@
#!/usr/bin/env pwsh
-$ErrorActionPreference = "Stop"
-
$env:CSHARP_POST_PROCESS_FILE = ""
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
@@ -9,15 +7,6 @@ java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
-g csharp `
-o . `
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
- --additional-properties=packageName=Tribufu,library=restsharp,targetFramework=net47,zeroBasedEnums=true `
+ --additional-properties=packageName=Tribufu,library=restsharp,zeroBasedEnums=true,nullableReferenceTypes=true `
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
--skip-validate-spec
-
-$srcDir = "./src"
-$sourceDir = "./Source"
-
-if (Test-Path $srcDir) {
- New-Item -ItemType Directory -Force -Path $sourceDir | Out-Null
- Copy-Item -Path (Join-Path $srcDir "*") -Destination $sourceDir -Recurse -Force
- Remove-Item $srcDir -Recurse -Force
-}
diff --git a/scripts/package.ps1 b/scripts/package.ps1
new file mode 100644
index 0000000..b496845
--- /dev/null
+++ b/scripts/package.ps1
@@ -0,0 +1,7 @@
+#!/usr/bin/env pwsh
+
+Get-ChildItem ./releases -Filter *.nupkg -Recurse -Force | Remove-Item -Force
+
+dotnet clean
+dotnet build -c Release
+dotnet pack -c Release -o ./releases
diff --git a/Source/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs b/src/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
similarity index 100%
rename from Source/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
rename to src/Tribufu.AspNetCore/Extensions/HttpContextExtensions.cs
diff --git a/Source/Tribufu.AspNetCore/README.md b/src/Tribufu.AspNetCore/README.md
similarity index 100%
rename from Source/Tribufu.AspNetCore/README.md
rename to src/Tribufu.AspNetCore/README.md
diff --git a/Source/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj b/src/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
similarity index 100%
rename from Source/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
rename to src/Tribufu.AspNetCore/Tribufu.AspNetCore.csproj
diff --git a/Source/Tribufu.ComponentModel/EnumMemberConverter.cs b/src/Tribufu.ComponentModel/EnumMemberConverter.cs
similarity index 100%
rename from Source/Tribufu.ComponentModel/EnumMemberConverter.cs
rename to src/Tribufu.ComponentModel/EnumMemberConverter.cs
diff --git a/Source/Tribufu.ComponentModel/README.md b/src/Tribufu.ComponentModel/README.md
similarity index 100%
rename from Source/Tribufu.ComponentModel/README.md
rename to src/Tribufu.ComponentModel/README.md
diff --git a/Source/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj b/src/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
similarity index 100%
rename from Source/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
rename to src/Tribufu.ComponentModel/Tribufu.ComponentModel.csproj
diff --git a/Source/Tribufu.Configuration/ConfigurationLoader.cs b/src/Tribufu.Configuration/ConfigurationLoader.cs
similarity index 100%
rename from Source/Tribufu.Configuration/ConfigurationLoader.cs
rename to src/Tribufu.Configuration/ConfigurationLoader.cs
diff --git a/Source/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs b/src/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
similarity index 100%
rename from Source/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
rename to src/Tribufu.Configuration/Extensions/IConfigurationExtensions.cs
diff --git a/Source/Tribufu.Configuration/README.md b/src/Tribufu.Configuration/README.md
similarity index 100%
rename from Source/Tribufu.Configuration/README.md
rename to src/Tribufu.Configuration/README.md
diff --git a/Source/Tribufu.Configuration/Tribufu.Configuration.csproj b/src/Tribufu.Configuration/Tribufu.Configuration.csproj
similarity index 100%
rename from Source/Tribufu.Configuration/Tribufu.Configuration.csproj
rename to src/Tribufu.Configuration/Tribufu.Configuration.csproj
diff --git a/src/Tribufu.EntityFrameworkCore/DatabaseConfiguration.cs b/src/Tribufu.EntityFrameworkCore/DatabaseConfiguration.cs
new file mode 100644
index 0000000..7619c8a
--- /dev/null
+++ b/src/Tribufu.EntityFrameworkCore/DatabaseConfiguration.cs
@@ -0,0 +1,105 @@
+// Copyright (c) Tribufu. All Rights Reserved.
+// SPDX-License-Identifier: MIT
+
+using Microsoft.Extensions.Configuration;
+using System;
+
+namespace Tribufu.EntityFrameworkCore
+{
+ public class DatabaseConfiguration
+ {
+ public DatabaseDriver Driver { get; set; }
+
+ public string? Version { get; set; }
+
+ public string? Host { get; set; }
+
+ public string? Port { get; set; }
+
+ public string? User { get; set; }
+
+ public string? Password { get; set; }
+
+ public string? Schema { get; set; }
+
+ ///
+ /// Loads the from the "database" section or from root-level keys prefixed with "database_".
+ ///
+ /// The configuration source.
+ /// The populated instance.
+ public static DatabaseConfiguration Load(IConfiguration configuration)
+ {
+ var section = configuration.GetSection("database");
+ var useRootFallback = !section.Exists();
+
+ string? GetConfig(string key) => useRootFallback ? configuration[$"database_{key}"] : section[key];
+
+ var driverString = GetConfig("driver") ?? throw new Exception("Missing database driver");
+ if (!Enum.TryParse(driverString, true, out var driver))
+ {
+ throw new Exception($"Unsupported database driver: {driverString}");
+ }
+
+ return new DatabaseConfiguration
+ {
+ Driver = driver,
+ Version = GetConfig("version"),
+ Host = GetConfig("host"),
+ Port = GetConfig("port"),
+ User = GetConfig("user"),
+ Password = GetConfig("password"),
+ Schema = GetConfig("schema")
+ };
+ }
+
+ /*
+ services.AddDbContext(options =>
+ {
+ switch (dbConfig.Driver)
+ {
+ case DatabaseDriver.MySql:
+ var mysqlConnection = $"Server={dbConfig.Host};Port={dbConfig.Port};Uid={dbConfig.User};Pwd={dbConfig.Password};Database={dbConfig.Schema};ConvertZeroDateTime=True;";
+ options.UseMySql(mysqlConnection, ServerVersion.Parse(dbConfig.Version ?? "8.0"), mySqlOptions => { });
+ break;
+ case DatabaseDriver.Postgres:
+ var pgsqlConnection = $"Host={dbConfig.Host};Port={dbConfig.Port};Database={dbConfig.Schema};Username={dbConfig.User};Password={dbConfig.Password};";
+ options.UseNpgsql(pgsqlConnection, npgsqlOptions => { });
+ break;
+ case DatabaseDriver.SqlServer:
+ var sqlServerConnection = $"Server={dbConfig.Host},{dbConfig.Port};Database={dbConfig.Schema};User Id={dbConfig.User};Password={dbConfig.Password};Encrypt=True;TrustServerCertificate=True;";
+ options.UseSqlServer(sqlServerConnection, sqlOptions => { });
+ break;
+ case DatabaseDriver.Oracle:
+ var oracleConnection = $"User Id={dbConfig.User};Password={dbConfig.Password};Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST={dbConfig.Host})(PORT={dbConfig.Port})))(CONNECT_DATA=(SERVICE_NAME={dbConfig.Schema})));";
+ options.UseOracle(oracleConnection, oracleOptions => { });
+ break;
+ case DatabaseDriver.Firebird:
+ var firebirdConnection = $"User={dbConfig.User};Password={dbConfig.Password};Database={dbConfig.Host}:{dbConfig.Port}/{dbConfig.Schema};Dialect=3;";
+ options.UseFirebird(firebirdConnection, firebirdOptions => { });
+ break;
+ case DatabaseDriver.Sqlite:
+ var savedDirectory = Paths.GetApplicationSavedDirectory();
+ if (!Directory.Exists(savedDirectory)) Directory.CreateDirectory(savedDirectory);
+ var sqliteDatabaseFile = string.IsNullOrEmpty(dbConfig.Schema) ? "default.db" : $"{dbConfig.Schema}.db";
+ var sqliteDatabasePath = Path.Combine(savedDirectory, sqliteDatabaseFile);
+ options.UseSqlite($"Data Source={sqliteDatabasePath}", sqliteOptions => { });
+ break;
+ case DatabaseDriver.MongoDb:
+ var mongoUriBuilder = new MongoUrlBuilder
+ {
+ Server = new MongoServerAddress(dbConfig.Host, int.Parse(dbConfig.Port ?? "27017")),
+ Username = dbConfig.User,
+ Password = dbConfig.Password,
+ DatabaseName = dbConfig.Schema
+ };
+ var mongoClient = new MongoClient(mongoUriBuilder.ToMongoUrl());
+ var mongoDatabase = mongoClient.GetDatabase(dbConfig.Schema ?? "default");
+ options.UseMongoDB(mongoDatabase.Client, mongoDatabase.DatabaseNamespace.DatabaseName);
+ break;
+ default:
+ throw new NotSupportedException($"Unsupported database driver: {dbConfig.Driver}");
+ }
+ });
+ */
+ }
+}
diff --git a/src/Tribufu.EntityFrameworkCore/DatabaseConstants.cs b/src/Tribufu.EntityFrameworkCore/DatabaseConstants.cs
new file mode 100644
index 0000000..8b51fc4
--- /dev/null
+++ b/src/Tribufu.EntityFrameworkCore/DatabaseConstants.cs
@@ -0,0 +1,12 @@
+// Copyright (c) Tribufu. All Rights Reserved.
+// SPDX-License-Identifier: MIT
+
+namespace Tribufu.EntityFrameworkCore
+{
+ public static class DatabaseConstants
+ {
+ public const uint DEFAULT_PAGINATION = 20;
+
+ public const uint MAX_PAGINATION = 100;
+ }
+}
diff --git a/src/Tribufu.EntityFrameworkCore/DatabaseDriver.cs b/src/Tribufu.EntityFrameworkCore/DatabaseDriver.cs
new file mode 100644
index 0000000..d904e83
--- /dev/null
+++ b/src/Tribufu.EntityFrameworkCore/DatabaseDriver.cs
@@ -0,0 +1,22 @@
+// Copyright (c) Tribufu. All Rights Reserved.
+// SPDX-License-Identifier: MIT
+
+namespace Tribufu.EntityFrameworkCore
+{
+ public enum DatabaseDriver : byte
+ {
+ MySql = 0,
+
+ Postgres = 1,
+
+ SqlServer = 2,
+
+ Oracle = 3,
+
+ Firebird = 4,
+
+ Sqlite = 5,
+
+ MongoDb = 6,
+ }
+}
diff --git a/Source/Tribufu.EntityFrameworkCore/README.md b/src/Tribufu.EntityFrameworkCore/README.md
similarity index 100%
rename from Source/Tribufu.EntityFrameworkCore/README.md
rename to src/Tribufu.EntityFrameworkCore/README.md
diff --git a/Source/Tribufu.EntityFrameworkCore/IRepository.cs b/src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs
similarity index 64%
rename from Source/Tribufu.EntityFrameworkCore/IRepository.cs
rename to src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs
index 0e00b08..dbb4b19 100644
--- a/Source/Tribufu.EntityFrameworkCore/IRepository.cs
+++ b/src/Tribufu.EntityFrameworkCore/Repositories/IRepository.cs
@@ -4,25 +4,23 @@
using System.Collections.Generic;
using System.Threading.Tasks;
-namespace Tribufu.EntityFrameworkCore
+namespace Tribufu.EntityFrameworkCore.Repositories
{
public interface IRepository where T : class
{
- void Seed();
-
Task SeedAsync();
- IList List();
+ IList GetAll();
- Task> ListAsync();
+ Task> GetAllAsync();
- IList List(uint page, uint limit);
+ IList GetPage(uint page, uint limit);
- Task> ListAsync(uint page, uint limit);
+ Task> GetPageAsync(uint page, uint limit);
- T? Find(K key);
+ T? GetOne(K key);
- Task FindAsync(K key);
+ Task GetOneAsync(K key);
T? Create(T entity);
diff --git a/Source/Tribufu.EntityFrameworkCore/Repository.cs b/src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs
similarity index 70%
rename from Source/Tribufu.EntityFrameworkCore/Repository.cs
rename to src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs
index 6851858..c70a3c5 100644
--- a/Source/Tribufu.EntityFrameworkCore/Repository.cs
+++ b/src/Tribufu.EntityFrameworkCore/Repositories/Repository.cs
@@ -7,54 +7,50 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Tribufu.EntityFrameworkCore
+namespace Tribufu.EntityFrameworkCore.Repositories
{
public class Repository : IRepository where C : DbContext where T : class
{
- protected readonly C _dbContext;
+ protected readonly C _context;
protected readonly DbSet _dbSet;
- public Repository(C dbContext)
- {
- _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
- _dbSet = dbContext.Set();
- }
-
- public virtual void Seed()
+ public Repository(C context)
{
+ _context = context ?? throw new ArgumentNullException(nameof(context));
+ _dbSet = context.Set();
}
public virtual async Task SeedAsync()
{
}
- public virtual IList List()
+ public virtual IList GetAll()
{
return [.. _dbSet];
}
- public virtual async Task> ListAsync()
+ public virtual async Task> GetAllAsync()
{
return await _dbSet.ToListAsync();
}
- public virtual IList List(uint page, uint limit)
+ public virtual IList GetPage(uint page, uint limit)
{
return _dbSet.Skip((int)((page < 1 ? 0 : page - 1) * limit)).Take((int)limit).ToList();
}
- public virtual async Task> ListAsync(uint page, uint limit)
+ public virtual async Task> GetPageAsync(uint page, uint limit)
{
return await _dbSet.Skip((int)((page < 1 ? 0 : page - 1) * limit)).Take((int)limit).ToListAsync();
}
- public virtual T? Find(K key)
+ public virtual T? GetOne(K key)
{
return _dbSet.Find(key);
}
- public virtual async Task FindAsync(K key)
+ public virtual async Task GetOneAsync(K key)
{
return await _dbSet.FindAsync(key);
}
@@ -62,28 +58,29 @@ namespace Tribufu.EntityFrameworkCore
public virtual T? Create(T entity)
{
_dbSet.Add(entity);
- var result = _dbContext.SaveChanges();
+
+ var result = _context.SaveChanges();
return result > 0 ? entity : null;
}
public virtual async Task CreateAsync(T entity)
{
await _dbSet.AddAsync(entity);
- var result = await _dbContext.SaveChangesAsync();
+ var result = await _context.SaveChangesAsync();
return result > 0 ? entity : null;
}
public virtual T? Update(T entity)
{
_dbSet.Update(entity);
- var result = _dbContext.SaveChanges();
+ var result = _context.SaveChanges();
return result > 0 ? entity : null;
}
public virtual async Task UpdateAsync(T entity)
{
_dbSet.Update(entity);
- var result = await _dbContext.SaveChangesAsync();
+ var result = await _context.SaveChangesAsync();
return result > 0 ? entity : null;
}
@@ -108,13 +105,13 @@ namespace Tribufu.EntityFrameworkCore
public virtual void Delete(T entity)
{
_dbSet.Remove(entity);
- _dbContext.SaveChanges();
+ _context.SaveChanges();
}
public virtual async Task DeleteAsync(T entity)
{
_dbSet.Remove(entity);
- await _dbContext.SaveChangesAsync();
+ await _context.SaveChangesAsync();
}
}
}
diff --git a/Source/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj b/src/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
similarity index 100%
rename from Source/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
rename to src/Tribufu.EntityFrameworkCore/Tribufu.EntityFrameworkCore.csproj
diff --git a/Source/Tribufu.Example/Program.cs b/src/Tribufu.Example/Program.cs
similarity index 100%
rename from Source/Tribufu.Example/Program.cs
rename to src/Tribufu.Example/Program.cs
diff --git a/Source/Tribufu.Example/Tribufu.Example.csproj b/src/Tribufu.Example/Tribufu.Example.csproj
similarity index 100%
rename from Source/Tribufu.Example/Tribufu.Example.csproj
rename to src/Tribufu.Example/Tribufu.Example.csproj
diff --git a/Source/Tribufu.Logging/LogLevel.cs b/src/Tribufu.Logging/LogLevel.cs
similarity index 100%
rename from Source/Tribufu.Logging/LogLevel.cs
rename to src/Tribufu.Logging/LogLevel.cs
diff --git a/Source/Tribufu.Logging/Logger.cs b/src/Tribufu.Logging/Logger.cs
similarity index 100%
rename from Source/Tribufu.Logging/Logger.cs
rename to src/Tribufu.Logging/Logger.cs
diff --git a/Source/Tribufu.Logging/README.md b/src/Tribufu.Logging/README.md
similarity index 100%
rename from Source/Tribufu.Logging/README.md
rename to src/Tribufu.Logging/README.md
diff --git a/Source/Tribufu.Logging/Tribufu.Logging.csproj b/src/Tribufu.Logging/Tribufu.Logging.csproj
similarity index 100%
rename from Source/Tribufu.Logging/Tribufu.Logging.csproj
rename to src/Tribufu.Logging/Tribufu.Logging.csproj
diff --git a/Source/Tribufu.Platform/FlakeGenerator.cs b/src/Tribufu.Platform/FlakeGenerator.cs
similarity index 100%
rename from Source/Tribufu.Platform/FlakeGenerator.cs
rename to src/Tribufu.Platform/FlakeGenerator.cs
diff --git a/Source/Tribufu.Platform/Paths.cs b/src/Tribufu.Platform/Paths.cs
similarity index 100%
rename from Source/Tribufu.Platform/Paths.cs
rename to src/Tribufu.Platform/Paths.cs
diff --git a/Source/Tribufu.Platform/README.md b/src/Tribufu.Platform/README.md
similarity index 100%
rename from Source/Tribufu.Platform/README.md
rename to src/Tribufu.Platform/README.md
diff --git a/Source/Tribufu.Platform/Tribufu.Platform.csproj b/src/Tribufu.Platform/Tribufu.Platform.csproj
similarity index 100%
rename from Source/Tribufu.Platform/Tribufu.Platform.csproj
rename to src/Tribufu.Platform/Tribufu.Platform.csproj
diff --git a/Source/Tribufu.Serialization/BaseClassFirstContractResolver.cs b/src/Tribufu.Serialization/BaseClassFirstContractResolver.cs
similarity index 100%
rename from Source/Tribufu.Serialization/BaseClassFirstContractResolver.cs
rename to src/Tribufu.Serialization/BaseClassFirstContractResolver.cs
diff --git a/Source/Tribufu.Serialization/CustomSerializerSettings.cs b/src/Tribufu.Serialization/CustomSerializerSettings.cs
similarity index 100%
rename from Source/Tribufu.Serialization/CustomSerializerSettings.cs
rename to src/Tribufu.Serialization/CustomSerializerSettings.cs
diff --git a/Source/Tribufu.Serialization/DecimalNullableStringConverter.cs b/src/Tribufu.Serialization/DecimalNullableStringConverter.cs
similarity index 100%
rename from Source/Tribufu.Serialization/DecimalNullableStringConverter.cs
rename to src/Tribufu.Serialization/DecimalNullableStringConverter.cs
diff --git a/Source/Tribufu.Serialization/DecimalStringConverter.cs b/src/Tribufu.Serialization/DecimalStringConverter.cs
similarity index 100%
rename from Source/Tribufu.Serialization/DecimalStringConverter.cs
rename to src/Tribufu.Serialization/DecimalStringConverter.cs
diff --git a/Source/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs b/src/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
similarity index 100%
rename from Source/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
rename to src/Tribufu.Serialization/NetworkAwareSnakeCaseNamingStrategy.cs
diff --git a/Source/Tribufu.Serialization/README.md b/src/Tribufu.Serialization/README.md
similarity index 100%
rename from Source/Tribufu.Serialization/README.md
rename to src/Tribufu.Serialization/README.md
diff --git a/Source/Tribufu.Serialization/Tribufu.Serialization.csproj b/src/Tribufu.Serialization/Tribufu.Serialization.csproj
similarity index 100%
rename from Source/Tribufu.Serialization/Tribufu.Serialization.csproj
rename to src/Tribufu.Serialization/Tribufu.Serialization.csproj
diff --git a/Source/Tribufu.Serialization/ULongNullableStringConverter.cs b/src/Tribufu.Serialization/ULongNullableStringConverter.cs
similarity index 100%
rename from Source/Tribufu.Serialization/ULongNullableStringConverter.cs
rename to src/Tribufu.Serialization/ULongNullableStringConverter.cs
diff --git a/Source/Tribufu.Serialization/ULongStringConverter.cs b/src/Tribufu.Serialization/ULongStringConverter.cs
similarity index 100%
rename from Source/Tribufu.Serialization/ULongStringConverter.cs
rename to src/Tribufu.Serialization/ULongStringConverter.cs
diff --git a/Source/Tribufu/Api/TribufuGeneratedApi.cs b/src/Tribufu/Api/TribufuGeneratedApi.cs
similarity index 88%
rename from Source/Tribufu/Api/TribufuGeneratedApi.cs
rename to src/Tribufu/Api/TribufuGeneratedApi.cs
index 096ce48..c861352 100644
--- a/Source/Tribufu/Api/TribufuGeneratedApi.cs
+++ b/src/Tribufu/Api/TribufuGeneratedApi.cs
@@ -3,7 +3,7 @@
*
* API to access Tribufu services.
*
- * The version of the OpenAPI document: 1.4.3
+ * The version of the OpenAPI document: 1.2.6
* Contact: contact@tribufu.com
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
@@ -37,7 +37,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// CodeResponse
- CodeResponse Authorize(AuthorizeRequest authorizeRequest = default(AuthorizeRequest), int operationIndex = 0);
+ CodeResponse Authorize(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0);
///
/// Authorize the client to access the user information.
@@ -49,7 +49,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// ApiResponse of CodeResponse
- ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest authorizeRequest = default(AuthorizeRequest), int operationIndex = 0);
+ ApiResponse AuthorizeWithHttpInfo(AuthorizeRequest? authorizeRequest = default(AuthorizeRequest?), int operationIndex = 0);
///
/// Change the email of a user.
///
@@ -61,7 +61,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
///
- void ChangeEmail(string id, Object body = default(Object), int operationIndex = 0);
+ void ChangeEmail(string id, Object? body = default(Object?), int operationIndex = 0);
///
/// Change the email of a user.
@@ -74,7 +74,7 @@ namespace Tribufu.Api
/// (optional)
/// Index associated with the operation.
/// ApiResponse of Object(void)
- ApiResponse