Base solution for your next web application

Activities of "omar"

I am working on a school application. Every year, each school setup a school year, Ex. 2017-2018, 2016-2017, etc

Tenant admins(schools administrators) are responsible to set the school year. How would I create a filter based on the selected year of the administrator? The idea is to set that filter at the beginning of the request for the selected school year.

Thank you!

I trying to find the best way to implement cache per tenancy. As of right now, I am generating a cache key with the tenant id as follow.

var cacheKeyName  = $"tenant-{tenantId}";
ICache tenantCache = _cacheManager.GetCache(cacheKeyName );

Inside tenantCache, I have all cached entities that only belong to that tenant. For example, the tenantCache has entities like Student, Class, Course, etc.

Is this a good approach to manage the cache for the application?

Thank You!

When I try to run the application using "Start without debugging", I get an exception. "No owin.Environment item was found in the context". However, when I start the application in "Start debugging" the app runs without any problem.

The exception is being thrown at the account controller.

private IAuthenticationManager AuthenticationManager
        {
            get
            {
                return HttpContext.GetOwinContext().Authentication;
            }
        }

Any suggestion on how to identify this problem?

Thank you for your help. The content for the notification will be generated by each entity. Each of the following entity will generate a notification.

I am creating a student management system, I need to be able to send a notification on different platforms, such as SMS, email, website, etc. These notification will be sent based on particular events as listed below: • The teacher posted the grade for an assignment • Student is late or absent • A teacher posted a new assignment

Should I have an event handler for each entity or should I have a “NotificationsEventHandler” that handles all the notification generated by updating or creating entities?

//
public class NotificationsEventHandler : 
    IEventHandler<EntityCreatedEventData<Assignment>>,
    IEventHandler<EntityCreatedEventData<Grade>>, 
   IEventHandler<EntityCreatedEventData<Attendance>>,
		.
		.
		.
{

}

I am working in an application where the user is assigned a single role. How can I have access to the users' role name in the AbpSession. What would be the best way to achieve this and have access to the role's name in the server and the client?

Thank you for your help. In case anyone need it.

class User

[Required(AllowEmptyStrings=true)]
        public override string EmailAddress { get; set; }

UserManager

public override async Task<IdentityResult> CheckDuplicateUsernameOrEmailAddressAsync(long? expectedUserId, string userName, string emailAddress)
        {
            var user = (await FindByNameAsync(userName));
            if (user != null && user.Id != expectedUserId)
            {
                return AbpIdentityResult.Failed(string.Format("Name {0} is already taken.", userName));
            }

            // if email  address was provided, check that it does not exist
            if (!string.IsNullOrEmpty(emailAddress))
            {
                user = (await FindByEmailAsync(emailAddress));
                if (user != null && user.Id != expectedUserId)
                {
                    return AbpIdentityResult.Failed(string.Format("Email Address {0} is already taken.", emailAddress));
                }
            }

            return IdentityResult.Success;
        }

You mentioned that "this may break login". I was going over the AbpUserManager.cs class, but I was not able to find a problem since the LoginAsyncInternal function use the username or email to login. Any idea where this will break? Thanks again

Thank You!

I would like to create new users with no emails. Inside my UserManager's constructor, I have the following code:

UserValidator = new UserValidator<User, long>(this)
            {
                 RequireUniqueEmail = false,                
             };

However, I am still getting a validation error with an empty email address.

What would be the best place to put an event handler given the template structure downloaded from the site. Core Application Web WebApi

I would like to use the application services created in Project.Application to query information and email the user. How can i handle async actions inside my ExampleEventHandler?

Thanks

Showing 1 to 10 of 16 entries