Set internal modifier on extension methods on object CloudinaryDotNet.Core.SystemExtension
まだ誰も着手していません。
評価
調査の方向性
CloudinaryDotNet.Core.SystemExtension を探し、その使用箇所を調べて、Clone と CopyPropertiesTo が内部でのみ必要とされていることを確認します。要求どおりに公開 API を変更し、その後 SDK をビルドして利用可能なテストを実行し、内部の呼び出し元が引き続き動作し、拡張メソッドが公開状態では使用できなくなっていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Removing of a "feature" request for Cloudinary .NET SDK
CloudinaryDotNet.Core add extensions methods to object base type, which might be used by the library itselve, but shouldn't be public and usable on a project using this library.
The two following extension methods must be internal only:
namespace CloudinaryDotNet.Core;
public static class SystemExtension
{
/// <summary>Clones the object.</summary>
/// <param name="source">The source to clone.</param>
/// <typeparam name="T">Object type.</typeparam>
/// <returns>New instance of the cloned object.</returns>
public static T Clone<T>(this T source)
{
return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject((object) source));
}
/// <summary>
/// Copies the writable properties from the source object to the destination object.
/// </summary>
/// <param name="source">The source object whose properties will be copied.</param>
/// <param name="destination">The destination object where the properties will be copied.</param>
public static void CopyPropertiesTo(this object source, object destination)
{
foreach (PropertyInfo runtimeProperty in typeof (FileDescription).GetRuntimeProperties())
{
if (runtimeProperty.CanWrite)
{
object obj = runtimeProperty.GetValue(source);
runtimeProperty.SetValue(destination, obj);
}
}
}
}
Explain your use case
I shouldn't be able to use these methods on any object of my domain, system object, etc.
For example, this code is "syntaxically" ok, but absolutely not in execution:
System.Net.Http.SocketsHttpHandler handler = new System.Net.Http.SocketsHttpHandler();
handler.Clone();
Describe the problem you’re trying to solve
From my point of view, this is the responsibility of each projects to add the extension methods they need on base system type.
When I use a library to simplify access to cloudinary API, i don't expect to get some system type helper methods, which:
- will not works as i expect regarding they naming. Each people will have a different perception of what a "Clone" method do, maybe from your use case, Json IN/OUT is enough, but for another person, it will not be the case.
- will create a dependence on the library outside of the desired scope. (CloudinaryDotNet.Core would be used only on a "CdnConnectorService", but might be used everywhere because of that. )
Do you have a proposed solution?
Set these methods / extension class as internal instead of public.
(thanks for your work on the library btw! :) )
- 主要言語
- C#
- スター
- 105
- フォーク
- 72
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudinary/CloudinaryDotNet のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cloudinary/CloudinaryDotNet#385 · コメント 5 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
cloudinary/CloudinaryDotNet#383 · コメント 1 件 ·
-
Create New Sample Project with Generative AI and Special Use Cases再び着手できるかも @Nupoor10 が 768 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
cloudinary/CloudinaryDotNet#369 · コメント 4 件 ·
-
Update the Sample Project再び着手できるかも @arya2004 が 772 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
cloudinary/CloudinaryDotNet#368 · コメント 4 件 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
cloudinary/CloudinaryDotNet#362 · コメント 1 件 ·
cloudinary/CloudinaryDotNet の issue をすべて見る
似ている issue
-
area / templates
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
bitfoundation/bitplatform#15109 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
aikido critical security
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
dequelabs/axe-core-nuget#305 ·
-
:watch: Not Triaged dotnet-fundamentals/svc install/subsvc
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信