Skip to content
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

[WIP] Idea: One Handler rule both Asp.Net and Asp.Net-Core #29

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

John0King
Copy link
Contributor

@John0King John0King commented May 3, 2018

!!! 不要合并, DO NOT MERGE

To do

  • PaySharp.Target.AspNetCore (current name : PaySharp.AspNetCore)
  • PaySharp.Target.AspNet (current name : PaySharp.AspNet)
  • DI is optional for both Asp.Net and Asp.Net Core
  • NotifyHub as an adaptor for multiple HubHandler (one handler per hub)
  • logging
  • Gateway integrate
    • Alipay
    • WechatPay
    • UnionPay
    • Tenpay

description

big picture

big picture

  1. 目前, DI 是可选的,尽量不要强制引用一些特定框架的nuget包 , 具体实现的支付程序 不需要去自己管理 DI, 而是DI的相关操作 对 IGatewayBuilder 添加 。
  2. 尽量不要采用 条件编译, Asp.Net 和 Asp.Net Core 是运行在 .net framework 上的两个框架(Asp.Net Core 可以在其他平台 如 .net core 平台运行), 如果采用 条件编译, 请确定你的条件是 TargetFramework 而不是 Asp.Net/Asp.Net-Core
  3. 目前还没有Logging , 尽管我非常希望可以使用 Microsoft.Extensions.Logging.Abstractions 这个 Logger 适配器, 不过到2.0之后,他的编译目标是 .net standard 2.0 ,也就是 如果小于 .net framework 4.6.1 无法使用,如果我们要让 .net 45 也能使用,我们要么降级 1.x 版本, 要么做我们自己的抽象层

希望大家可以多多提供意见

@John0King John0King mentioned this pull request May 3, 2018
buildAction(builder);
}
return builder.Build();
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像这里 上面用 Singletion 下面用 Scoped 不行呢, 好像会重复添加

Copy link
Contributor Author

@John0King John0King May 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add 的时候使用Lazy<T> , 好像可以, 不过我发现,我有点偏离了我的目标, 我打算 发起支付的 部分叫 Client , 处理回调的部分叫 NotifyHandler , 这样用 Layz<T> 也不是不行,感觉不如 IServiceProvider 给力 , 先试试 Lazy<T> 能走多远吧

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

恩恩,先走走看吧,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants