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

Activities of "ajayak"

I want to detach a nested entity to avoid automatic db insertions. Here is sample code:

foreach (var refund in order.Refunds)
            {
                context.Entry(refund).State = EntityState.Detached;
            }

How I get context in DomainServiceBase class?

Swagger throws 400 server error when I add route attributes on Methods in my AppService. Example:

[Route("/api/services/MyAppService")]
Question

Hi,

I see that swagger is configured in Web.Host project as follows:

app.UseSwaggerUI(options =>
            {
                options.SwaggerEndpoint("/swagger/v1/swagger.json", "PrimePenguin API V1");
            });

Web.Host project also contains wwwroot/swagger/ui/index.html. How can I configure Swagger UI to use that index.html file?

Message: Must set LocalizationSourceName before, in order to get LocalizationSource Source: Abp className: "Abp.AbpException"

  •   $exception	{Abp.AbpException: Must set LocalizationSourceName before, in order to get LocalizationSource
    
    at Abp.BackgroundJobs.BackgroundJob1.get_LocalizationSource() in D:\Github\aspnetboilerplate\src\Abp\BackgroundJobs\BackgroundJob.cs:line 64 at Castle.Proxies.ShopifyPostInitializationJobProxy.L_callback(String name) at Castle.Proxies.Invocations.BackgroundJob1_L.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.ShopifyPostInitializationJobProxy.L(String name) at Cynet.PrimePenguin.SalesChannel.Shopify.ShopifyPostInitializationJob.<Execute>d__6.MoveNext() in C:\AK\PrimePenguin\PrimePenguin.Service\src\Cynet.PrimePenguin.Core\SalesChannel\Shopify\ShopifyPostInitializationJob.cs:line 51 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch()} Abp.AbpException

I switched to Hangfire for BackgroundJob. On enqueuing a background job, I get this error

Async void methods are not supported. Use async Task instead.

Here is the code:

public override async void Execute(long userId)
        {
            await DeleteWebhooks(userId);
        }

It works fine with default BackgroundJob manager

When I navigate to <a class="postlink" href="http://localhost:5000/hangfire/">http://localhost:5000/hangfire/</a> I get 401 status in network tab. Here is the config:

app.UseHangfireDashboard("/hangfire", new DashboardOptions
            {
                Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
            });

Hi,

I have configured Sendgrid SMTP Account and updated the Email settings in AspNetZero as follows: SMTP Host: smtp.sendgrid.net SMTP Port: 587 Use SSL: False Username: {{My SMTP Username}} Password: {{My Password}}

When I try to send test mail to my email address, I get a notification that mail was sent successfully but I don't receive any email. Am I doing something wrong?

I have the following code to read the Abp.AuthToken cookie from Request:

var context = _httpContextAccessor.HttpContext;
// Getting auth token from cookies as this request is coming from Shopify instead of my app
var authToken = context.Request.Cookies.FirstOrDefault(c => c.Key == "Abp.AuthToken");

This code works perfect on development but on Production, authToken.Value is empty. I verified that the cookie is visible in dev tools but not transfered.

How can I show loader when an HTTP call is made and hide when the call is completed?

In general case, I have an ApiBaseService class which is inherited by other ApiServices and the loading implementation is written in ApiBaseService. But in AspNetZero, api calls are made using auto-generated proxy service class. How can I show a common loader?

I am using saving a FullyAuditedEntity as:

var spotifyChannel = new UserSalesChannel()
            {
                AccessToken = accessToken,
                ChannelName = SalesChannelConst.Shopify,
                ChannelDomain = shop
            };
            _salesChannelRepository.Insert(spotifyChannel);

and the function is decorated with [UnitOfWork]. When I check database, the audited columns(creatorUserId etc) are null.

I am calling this function as:

using (_session.Use(tenantId.ToInt(), userId.ToInt()))
{
         await _shopifyManager.ValidateAndInstallHook(shop, code);
}

here tenantId is 2 and userId is 4. All the values are valid and AbpSession reflects correct values.

Showing 71 to 80 of 93 entries