Skip to content

Phat.Tran - Stripe - Sharing #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
8 changes: 8 additions & 0 deletions .Net/Payment/Stripe - Phat.Tran/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Planning-Book
Demo List:
- Create Customer
- Create Payment Method
- Checkout: One time, Subscription (Save payment method to customer for other checkout in future)
- Payment intent
- Discount/ Promotion Code
- Cancel Subscription
4 changes: 4 additions & 0 deletions .Net/Payment/Stripe - Phat.Tran/Servers/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = none
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.Reflection;

namespace PlanningBook.DBEngine
{
public abstract class BaseRelationDbEntityTypeConfiguration<TEntity> : IBaseEntityTypeConfiguration<TEntity>
where TEntity : class
{
public virtual void Configure(EntityTypeBuilder<TEntity> builder)
{
builder.ToTable($"{typeof(TEntity).Name}s");

var hasIdColumn = typeof(TEntity).GetProperty("Id", BindingFlags.Public | BindingFlags.Instance);
if(hasIdColumn != null)
{
builder.HasKey("Id");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace PlanningBook.DBEngine.Constants
{
public static class DBEngineConstants
{
public const string RootConnectionString = "DatabaseConnectionStrings";
public const string dbConnectionStringPrefix = "ConnectionString";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace PlanningBook.DBEngine
{
public interface IBaseEntityTypeConfiguration<TEntity> : IEntityTypeConfiguration<TEntity>
where TEntity : class
{
//void Configure(EntityTypeBuilder<TEntity> builder);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.7" />
</ItemGroup>

</Project>
Loading