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

Activities of "bilalhaidar"

Hello, Are there some steps to follow when deploying the application to Azure?

Thanks Bilal

Hi, I pushed the application today to a hosting online account. I could login but then I get no where, internal server error.

Here is the log I could find remotely:

DEBUG 2017-04-24 14:19:55,735 [10   ] Abp.Auditing.WebClientInfoProvider       - System.Net.Sockets.SocketException (0x80004005): No such host is known
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress()
DEBUG 2017-04-24 14:20:21,266 [10   ] Abp.Modules.AbpModuleManager             - Shutting down has been started
DEBUG 2017-04-24 14:20:21,266 [10   ] Abp.BackgroundJobs.BackgroundJobManager  - Stop background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2017-04-24 14:20:21,266 [10   ] Abp.BackgroundJobs.BackgroundJobManager  - WaitToStop background worker: Abp.BackgroundJobs.BackgroundJobManager
DEBUG 2017-04-24 14:20:21,266 [10   ] Abp.Modules.AbpModuleManager             - Shutting down completed.

I made sure I put the root address of the website in the web.config. Also, I enabled WebSockets on the application.

Thanks Bilal

Hi, I read in the documentation that whenever a code is withing UOW, there is no need to explicitly calling update method on the repository, as this is handled automatically by the framework.

What are the cases that I need to actually call update methods?

Thanks

Hi, I always find difficulty in using .Include() in methods inside DomainServices especially when the method is defined as async.

I tend to use:

var shelter = await Task.FromResult(_repository.GetAllIncluding(s => s.ParentShelter).FirstOrDefault(s => s.Id == id));

Is it the right way? Or there is a better one?

Thanks Bilal

Hi, In an AppService, I am getting from Database a list of entities that implement IMustHaveTenant.

The following code is throwing an exception:

[UnitOfWork]
        public async Task<PagedResultDto<PocListDto>> GetPocs(GetPocsInput input)
        {
            // Build query
            var query = CreatePocRegisterQuery(input);

            // Apply filter if any
            query = query
                .WhereIf(
                   !string.IsNullOrEmpty(input.Filter),
                   poc =>
                       poc.FirstName.ToLower().Contains(input.Filter.Trim().ToLower()) ||
                       poc.LastName.ToLower().Contains(input.Filter.Trim().ToLower())
               );

            int pocCount;
            List<PersonofConcern> pocs;
            using (UnitOfWorkManager.Current.SetTenantId(AbpSession.TenantId.Value))
            {
                // Execute the query
                pocCount = await query.CountAsync();
                pocs = await query.OrderBy(input.Sorting).PageBy(input).ToListAsync();
            }

            // Convert to Dtos
            var pocListDtos = pocs.MapTo<List<PocListDto>>();

            return new PagedResultDto<PocListDto>(
                pocCount,
                pocListDtos);
        }

Exception:

ERROR 2017-04-23 20:10:42,681 [10   ] nHandling.AbpApiExceptionFilterAttribute - Nullable object must have a value.
System.InvalidOperationException: Nullable object must have a value.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Nullable`1.get_Value()
   at Drc.OnlineSystems.Drc.Sms.PersonofConcernAppService.&lt;GetPocs&gt;d__7.MoveNext() in ...\PersonofConcernAppService.cs:line 69
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.Threading.InternalAsyncHelper.&lt;AwaitTaskWithPostActionAndFinallyAndGetResult&gt;d__5`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.Threading.InternalAsyncHelper.<AwaitTaskWithFinallyAndGetResult>d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Threading.Tasks.TaskHelpersExtensions.&lt;CastToObject&gt;d__3`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.WebApi.Uow.AbpApiUowFilter.<ExecuteActionFilterAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.WebApi.Validation.AbpApiValidationFilter.<ExecuteActionFilterAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.WebApi.Auditing.AbpApiAuditFilter.<ExecuteActionFilterAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.WebApi.Security.AntiForgery.AbpAntiForgeryApiFilter.<ExecuteAuthorizationFilterAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Abp.WebApi.Authorization.AbpApiAuthorizeFilter.<ExecuteAuthorizationFilterAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
ERROR 2017-04-23 20:11:34,029 [23   ] nHandling.AbpApiExceptionFilterAttribute - Nullable object must have a value.

Hello, I have an AppService that is managed by Tenant-Level permissions.

How can I allow Host-Level users to access that AppService, as per Abp.

Thanks Bilal

Hello, In one of the scenarios, I cannot inherit from the DomainService as I need to do case by case IoC by type. etc. However, in this case, I need to localize error messages.

So in the base class of a class, I add the following method:

protected ILocalizableString L(string name)
        {
            return new LocalizableString(name, OnlineSystemsConsts.LocalizationSourceName);
        }

The above method does return a localizable string.

Now 2 questions:

  • When it is time to send localized string to the client, I need to use UserFriendlyException. This exception requires a string. How to convert LocalizableString to string? With the above message, I can only call a Key without parameters. What if the localized string contains a placeholder {0}. How would be able to pass this value and get a localized string?

Thanks Bilal

Hello, I am in need to extend the Abp Framework heavily. In this regard, I've prepared my requirements and what I will be changing. I am seeing your kind review to see if I am thinking correctly in terms of Abp and whether my changes would cause any issues to the normal flow of the Abp Framework and hence the entire App.

Host Level

. For every new department, an OU is created. . Upon creation of a new OU, 4 Roles are to be created & each of these roles is assigned the OU ID that it belongs to. . A new Role Entity is to be created inheriting from the Role entity that ships with Abp. This new entity shall have a new property called OU of type OU. (1-to-many: A Role belongs to 1 OU and 1 OU contains multiple Roles). . A new OU entity is to be created inheriting from the OU entity that ships with Abp. This new entity shall have a new property called OU Head of type User. (1-to-many: An OU has 1 OU Head and 1 User can be the head of multiple OUs) . When a new user is being created, for each OU-Role selected, the user shall be "Add Member" to those OUs. So, a user might be added to multiple Roles that belong to multiple OUs, hence user shall be added to multiple OUs as a Member. . Add a new Entity called Region that is shared between both Host and Tenant levels. . A new Tenant Entity is to be created inheriting from the Tenant entity that ships with Abp. This new entity shall have a new property called Region of type Region entity. (1-to-many: A Tenant belongs to 1 Region while a Region contains multiple Tenants). . A new User entity is to be created inheriting from the User entity that ships with Abp. This new entity shall have a new property called TenantsToAccess of type List<Tenant>. (Many-to-Many: A user can have access to 1 or more Tenants while a Tenant can be accessed by many users). This feature is required as by extending User and adding a property of Sites to be accessed, the Web App shall present data (Tenant-Specific) based on what Tenants this user belongs to.

Some analysis: . A Role entity now belongs to an OU entity. For each department in my client's organization, they will request in the future features to be developed for them. Features might be difference hence Permissions might be different. That's why I thought of creating OU-specific Roles so that I can freely add/remove permissions as needed. . The User entity now contains a list of Tenants a user belongs to (Host Level). Later on, based on the Tenants/Region data from those Tenants will be presented to the user. So this way I can simulate a Host User accessing data from multiple Tenants. Here I will be using SetTenantId(Null) and then add my own WHERE clause to get data.

Questions . Does the Abp Framework fire an event on the Event Bus when a new User is created? . Does the Abp Framework fire an event on the Event Bus when a new OU is created? . Does the Abp Framework fire an event on the Event Bus when an existing Role is edited?

Tenant Level . Most of the concepts from Host Level are applied here too. . One exception to the above is that when creating a new Tenant Level User automatically the user is assigned the current Tenant and Admin cannot change it.

Hi, Based on a user selection, I need to load a Razor View in Angular 1.x passing to it an Id. The Razor View shall have a model of a collection of some records that I need to loop over in Razor to render the records.

How to go about it? Can I load an angular view with a razor model?

I found it is easier to loop over collection in Razor to added some controls dynamically than to do so in Angular

Thanks Bilal

Question

Hello, Do you have any documentation on how multitenancy was added to the framework? What are the needed changes so that the app would be a multi-tenant? I would appreciate that info.

Thanks

Showing 81 to 90 of 174 entries