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

Add error based response #68

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

Conversation

soroshsabz
Copy link
Member

ITNOA

This PR resolve #67

@soroshsabz soroshsabz marked this pull request as ready for review December 22, 2023 23:37
@soroshsabz soroshsabz added enhancement New feature or request BSN.Commons Main project and package labels Dec 22, 2023
@@ -0,0 +1,30 @@
**/.classpath
Copy link
Contributor

Choose a reason for hiding this comment

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

سلام؛
آقا ما از پروژه های این مخزن داکر ایمیج میسازیم ؟ فکر کنم به ازای هر Dockerfile باید یدونه از اینا داشته باشیم.

Copy link
Contributor

Choose a reason for hiding this comment

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

برای پروژه های تستی نیاز هست که DockerImage داشته باشیم ؟

/// Represents a single response of a command/query service with additional informations about invalid items.
/// </summary>
/// <typeparam name="ValidationResultType"></typeparam>
public interface IResponse<ValidationResultType> : IResponse
Copy link
Contributor

Choose a reason for hiding this comment

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

بهتر نیست اسم این واسط بشود
IValidatedResponse

public IList<ValidationResult> InvalidItems { get; set; }
[Obsolete("Due to incompatability with Grpc this response type is only used for backward compatibility.")]
[DataContract]
public class ErrorResponseBase : ResponseBase
Copy link
Contributor

Choose a reason for hiding this comment

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

این کلاس لازم است ؟

Copy link
Contributor

Choose a reason for hiding this comment

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

البته منم موافقم اینطور بشود.
یه کدهایی در PR خانوم سلطانزاده دیدم بنظرم مفید است.

در سرویس ها لازم نیست همه Return Typeها از جنس Response<> باشد. البته با حفظ سلسله مراتب ارث بری

در تولید ExampleResponse خیلی بچه ها را کمک میکند

@@ -22,4 +22,4 @@ public class InvalidItem
[DataMember(Order = 2)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Order = 1
نباید باشد ؟

@@ -53,36 +52,21 @@ public class Response: IResponse<InvalidItem>
/// namely the 'StatusCode' property of the 'ResponseBase' class which should keep it's default numeral value when being converted.
/// </remark>
[DataContract]
public class Response<T> where T : class
// TODO: [ProtoImplement(typeof(Response))]
public class Response<T> : Response where T : class
Copy link
Contributor

Choose a reason for hiding this comment

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

پیاده سازی این یه باگی دارد فکر کنم باید به ازای تمام T ها اون بساط ProtoImplement را اضافه کنیم

{
internal class GrpcTestContext<TStartup> : IDisposable where TStartup : class
{
private readonly Stopwatch _stopwatch;
Copy link
Contributor

Choose a reason for hiding this comment

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

اینها به انتهای فایل منتقل بشوند 🌹

{
internal class ForwardingLoggerProvider : ILoggerProvider
{
private readonly LogMessage _logAction;
Copy link
Contributor

Choose a reason for hiding this comment

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

اینها به انتهای فایل منتقل بشوند 🌹

{
public class IntegrationTestBase<TStartup> : IDisposable where TStartup : class
{
private GrpcChannel? _channel;
Copy link
Contributor

Choose a reason for hiding this comment

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

اینها هم همینطور

@@ -0,0 +1 @@
global using NUnit.Framework;
Copy link
Contributor

Choose a reason for hiding this comment

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

فکر کنم قرار بود از اینها استفاده نکنیم

@@ -0,0 +1,35 @@
using BSN.Commons.GrpcIntegrationTest.Sample.AppService.Contract;
Copy link
Contributor

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
BSN.Commons Main project and package enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add error based response
2 participants