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

Activities of "bilalhaidar"

Hi, I am making use of OU to provide some dropdown lists for users with the following hierarchy:

Region --> Camp --> Shelter --> Sub Shelter 1 / Sub Shelter 2 / ...

I want to be notified when:

Member is removed or added OU is removed or added or changed (name)

Can I make use of the Entity events something like "EntityCreatedEventData<OrganizationUnit>" and "EntityUpdatedEventData<OrganizationUnit>" and "EntityChangedEventData<OrganizationUnit>" and "EntityDeletedEventData<OrganizationUnit>"

One more thing, on the client side, do you trigger any events similar to the above? For instance, if an OU changes, I want to clear the Local Storage data (that I am using to cache the data in).

Finally, can I cancel for instance deleting an OU by handling "EntityDeletingEventData<OrganizationUnit>"? The reason I am asking for that is that maybe an OU is already used on another Entity and deleting it would break the data. So before deleting an OU, I would check if this OU that is being deleted is linked to some other entity, if yes, I halt the deletion process?

How is that possible? Any example, please.

Thanks Bilal

Hello, I keep on getting this error in the log file and I dunno where it is coming from.

How to fix it? Thanks

INFO  2017-08-15 01:06:12,952 [41   ] entication.JwtBearer.JwtBearerMiddleware - Failed to validate the token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyIiwibmFtZSI6ImFkbWluIiwiQXNwTmV0LklkZW50aXR5LlNlY3VyaXR5U3RhbXAiOiJlNzI5NTdjNi03MzhmLTEyYmMtNzllOS0zOWUwNTAxZjViYTkiLCJyb2xlIjoiQWRtaW4iLCJodHRwOi8vd3d3LmFzcG5ldGJvaWxlcnBsYXRlLmNvbS9pZGVudGl0eS9jbGFpbXMvdGVuYW50SWQiOiIxIiwianRpIjoiYzE1ZWYzYWItNWEwMi00YWI5LWFmYmMtNzg5MjRmNDA0YzM2IiwiaWF0IjoxNTAyNzQ4MzY5LCJuYmYiOjE1MDI3NDgzNjksImV4cCI6MTUwMjgzNDc2OSwiaXNzIjoiRHJjQXBwIiwiYXVkIjoiRHJjQXBwIn0.kUWfPsixYzjRKcmBsRLsv-WsMiNkssukZlRn-NSqDAY.
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: IDX10503: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.RsaSecurityKey , KeyId: d0fb06732fef51dd6712680ec9c1ae17
'.
Exceptions caught:
 ''.
token: '{"alg":"HS256","typ":"JWT"}.{"sub":"2","name":"admin","AspNet.Identity.SecurityStamp":"e72957c6-738f-12bc-79e9-39e0501f5ba9","role":"Admin","http://www.aspnetboilerplate.com/identity/claims/tenantId":"1","jti":"c15ef3ab-5a02-4ab9-afbc-78924f404c36","iat":1502748369,"nbf":1502748369,"exp":1502834769,"iss":"DrcApp","aud":"DrcApp"}'.
   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(String token, TokenValidationParameters validationParameters)
   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken)
   at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.<HandleAuthenticateAsync>d__1.MoveNext()
INFO  2017-08-15 01:06:12,952 [41   ] entication.JwtBearer.JwtBearerMiddleware - Bearer was not authenticated. Failure message: IDX10503: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.RsaSecurityKey , KeyId: d0fb06732fef51dd6712680ec9c1ae17
'.
Exceptions caught:
 ''.
token: '{"alg":"HS256","typ":"JWT"}.{"sub":"2","name":"admin","AspNet.Identity.SecurityStamp":"e72957c6-738f-12bc-79e9-39e0501f5ba9","role":"Admin","http://www.aspnetboilerplate.com/identity/claims/tenantId":"1","jti":"c15ef3ab-5a02-4ab9-afbc-78924f404c36","iat":1502748369,"nbf":1502748369,"exp":1502834769,"iss":"DrcApp","aud":"DrcApp"}'.

Hello, I have a domain object that should contain 2 properties of type OrganizationUnit.

In the application in hand, I am making use of OUs in such a way that I need a concept of Region and within a Region there are Camps. So when creating a new instance of this domain object the user will select a Region (i.e. OU) and then based on the Region selection I filter out a second dropdown list containing Camps (to display only children OUs of the Region OU).

So in summary when saved in the DB, this domain object should have Ids for both Region OU and optionally Camp OU Id.

As far as properties to be added to the domain object, it will be 2 properties of type OrganizationUnit. But for DB relations, what relations I shall place here and where on which object (so that EF would handle the relations etc, ..)

Every Domain object has 1 Region (OU) and 1 or 0 Camp (OU). So the relation is 1 to Many and 1 to 0/Many. (OU Region can contain more than 1 of the domain objects).

So shall I add 1 property on the domain object of type OrganizationUnit and called Region

And add another property of type OrganizationUnit and called Camp (but nullable as the relation is 1 to 0).

Do I need to add 2 collections on OrganizationUnit object?

Many Thanks Bilal

Hello, I am running a non-multitenant application. I don't see any option where to disable the chat feature.

Can you assist, please?

Thanks Bilal

Hi,

I've installed the AbpDapper nuget on both ApplicationServices and Web.Core applications.

I then added a dependency on the AbpDapperModule in the Web.Core right after the dependency for EntityFramework.

I also installed Dapper(1.50.2) and DapperExtensions. The Abp installed is 2.3.0.

I then used an IDapperRepository inside one of the ApplicationServices.

When I run the app, I get this exception:

An error occurred while starting the application.

MissingMethodException: Method not found: 'Castle.MicroKernel.Registration.ComponentRegistration`1&lt;!0&gt; Castle.MicroKernel.Registration.ComponentRegistration`1.UsingFactoryMethod(System.Converter`2&lt;Castle.MicroKernel.IKernel,!!0&gt;, Boolean)'.
Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.RegisterServiceDescriptor(IWindsorContainer container, ServiceDescriptor serviceDescriptor)

MissingMethodException: Method not found: 'Castle.MicroKernel.Registration.ComponentRegistration`1<!0> Castle.MicroKernel.Registration.ComponentRegistration`1.UsingFactoryMethod(System.Converter`2<Castle.MicroKernel.IKernel,!!0>, Boolean)'.
Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.RegisterServiceDescriptor(IWindsorContainer container, ServiceDescriptor serviceDescriptor)
Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.AddServicesCollection(IWindsorContainer container, IServiceCollection services)
Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.AddServices(IWindsorContainer container, IServiceCollection services)
Castle.Windsor.MsDependencyInjection.WindsorRegistrationHelper.CreateServiceProvider(IWindsorContainer container, IServiceCollection services)
Abp.AspNetCore.AbpServiceCollectionExtensions.AddAbp<TStartupModule>(IServiceCollection services, Action<AbpServiceOptions> optionsAction)
....Web.Startup.Startup.ConfigureServices(IServiceCollection services) in Startup.cs
+
            return services.AddAbp<DrcAppWebHostModule>(options =>
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

Hello, I added a migration, then requested to update the database. Tables were created successfully, but the seed data was not executed.

Then I noticed that the tables were created but missing my columns (i.e. properties).

In my case I have around 10 classes that share the same structure. Each class represents an entity that is used as reference data.

So I created a base class having those 2 properties and made those classes inheirt from that class. Something as this:

[Serializable]
    public class HostEntityBase<TPrimaryKey> : FullAuditedEntity<TPrimaryKey>
    {
        [Required]
        [StringLength(HostEntityConsts.MaxLabelLength)]
        public string Label { get; private set; }

        [StringLength(HostEntityConsts.MaxLabelDescriptionLength)]
        public virtual string Notes { get; private set; }

        public void UpdateLabel(string newLabel)
        {
            //Validate newLabel
            Check.NotNull(newLabel, nameof(newLabel));

            Label = newLabel;
        }

        public virtual void UpdateNotes(string newNotes)
        {
            Notes = newNotes;
        }

        public HostEntityBase()
        {
        }

        public HostEntityBase(string label, string notes)
        {
            UpdateLabel(label);
            UpdateNotes(notes);
        }
    }

Then each class inherits from this base and calls its constructor.

In the previous version (MVC 5/Angular js) it was working fine. But now with EF Core seems not to work. No columns were added on the tables?

Also, when I ran the app, the Seed ran. Where is that configured to do so? Usually, with update-database the Seed would run.

Thanks

Question

Hello, Is it possible to update NPM packages to the latest ones? I am using ASP.NET Core / Angular 4 app.

Thank you

Hello, I need your assistance with extending the moment typings.

I need to use this moment plugin: <a class="postlink" href="https://github.com/codebox/moment-precise-range">https://github.com/codebox/moment-precise-range</a>

This plugin adds a preciseDiff() function to the moment object.

Now, how can I add typings for this function? I need to extend the moment.d.ts so that I can start using the preciseDiff() function.

Can you assist me? That plugin has no typings and hence I need to do something about it. I tried to add the following in the typings.d.ts file.

/**
 * moment-precise-range
 */
declare module 'myMoment' {
    export namespace moment {
        export function preciseDiff(...any): any;
    }
}

Then in the code I would use something as:

import * as myMoment from 'myMoment';

myMoment.moment.preciseDiff()

No compilation errors, but when "ng serve" runs, I get this exception:

Module not found: Error: Can't resolve 'myMoment' in 'D:\Projects\...\app\sms\poc-edit'

Appreciate your help.

Thanks Bilal

Hello, When I run the Host application (Asp.NET core). Then I try to call of the Urls, I always get 404. Is there a step I need to do so that I can run APIs using swagger?

Thanks

Question

Hello,

In the *-routing.module.ts files you specify for each route an object of "data: { preload: true }".

Are you defining a preload-strategy somewhere? Otherwise, why add this property with preload:true?

Thanks

Showing 21 to 30 of 174 entries