Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "maharatha"

For now please ignore the issue related to wiring up the comments. I think I am able to do it. Will update this thread with my findings.

One more issue I figured out as compared to the below URL :

<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API#naming-convention">http://www.aspnetboilerplate.com/Pages/ ... convention</a>

This says if your method name starts with Get it will by default use Get http verb, but it doesn't work so. All methods except one or two all are Post

Question

Hi Hikalkan -

I loved the Swagguer implementation. Thank you a bunch for that. I have a problem in wiring the XML comments with Swagger. I tried someething like this :

.EnableSwagger(c =>
                {
                    c.SingleApiVersion("v1", "XXXXWebApi");
                    c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
                                             
                    c.IncludeXmlComments(@"C:\Source Code\XXX-YYYY\XMLComments\Application Module\AAAAA.BBBBB.Application.XML");
                })
                .EnableSwaggerUi();

Still unable to wire up[ the comments. I used the hard coded path as I am yet to figure out a smart solution to get the comment file path .

Please let me know if I am doing anything wrong

That would be awesome. I can definitely wait.

The problem is what do I do with the return value when I don't have the actual value in my return value.

Waiting eagerly for your document.

internal class DTOInterceptors : IInterceptor
    {
        public void Intercept(IInvocation invocation)
        {
            try
            {
                if (AsyncHelper.IsAsyncMethod(invocation.Method))
                {
                    PerformASyncDTOOperation(invocation);
                }
                else
                {
                    PerformSyncDTOOperation(invocation);
                }
            }
            catch (Exception ex)
            {
                // OnException(invocation, ex);
            }
        }


       


        private void PerformSyncDTOOperation(IInvocation invocation)
        {
            var stopwatch = Stopwatch.StartNew();

            try
            {
                invocation.Proceed();
            }
            catch (Exception ex)
            {

                throw;
            }
            finally
            {
                stopwatch.Stop();

            }
        }
        private void PerformASyncDTOOperation(IInvocation invocation)
        {
            var stopwatch = Stopwatch.StartNew();

            invocation.Proceed();

            if (invocation.Method.ReturnType == typeof(Task))
            {
                invocation.ReturnValue = InternalAsyncHelper.AwaitTaskWithFinally(
                    (Task)invocation.ReturnValue,
                    exception => SaveAuditInfo(stopwatch, exception)
                    );
            }
            else //Task<TResult>
            {
                invocation.ReturnValue = InternalAsyncHelper.CallAwaitTaskWithFinallyAndGetResult(
                    invocation.Method.ReturnType.GenericTypeArguments[0],
                    invocation.ReturnValue,
                    exception => SaveAuditInfo(stopwatch, exception)
                    );
            }
        }

        private void SaveAuditInfo(Stopwatch stopwatch, Exception exception)
        {
            stopwatch.Stop();



        }

    }

I am not doing much anything in the SyncMethods as I don't have the need. But when I try the Asyn Method I get :

e.g. invocation.ReturnValue = Id = 13743, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"

Hi Hikalkan -

I tried my hand with Intercepting the calls but I am unable to intercept the Async methods. Is there a way I can intercept the result of the Aync methods.

I see some explanation in the below link :

<a class="postlink" href="https://gist.github.com/hikalkan/1e5d0f0142484da994e0">https://gist.github.com/hikalkan/1e5d0f0142484da994e0</a>

But these aren't helpful.

Could you throw some light into it ? I am kind of stuck.

Thanks, Partha

I see you have created the IShouldNormalize interface for Input DTO , won't it be good if you implement similar stuff for normalizing or decorating the output DTO

Question

Hi Hilkan -

Thanks again for this amazing framework. Your support has been extraordinary. I am currently working on programatically showing and hiding properties for my DTOs. One approach I was thinking of is using Data Annotations and programatically set the data annotations based on user preference. Some of the values that the user can manipulate for each property are

  1. Visibility
  2. Width
  3. Display Name

I would be storing these values in a json string in my database for each dto at the Tenant level as well as the user level.

I am also planning to create a DTO manager which will have an input as a DTO , and then all the above manipulations would occur and then send the back the modified DTO before sending to the Web layer.

Could you suggest some design ideas on implementing the above ?

Thanks, Partha

Thank You Sir !!! :ugeek:

I am trying to send email from ABPZero. But our smtp server doesn't require any authentication, so what default credentials abp zero is passing

Showing 301 to 310 of 326 entries