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?

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?

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

Is it possible to get the user's role name when quering for a user.

var user =   UserManager.Users.Where(e => e.Id == input.Id)
              .Select(a => new UserEditDto
               {
                    Id = a.Id,
                    FirstName = a.Name,
                    LastName = a.Surname,
                    Email = a.EmailAddress,
                    UserName = a.UserName,                  
                    RoleId = a.Roles.FirstOrDefault().RoleId // i would like Role's name instead
                })
               .FirstOrDefault();

Thanks

I would like to use the same static roles for tenants. As of now, I have to create the roles for each tenant every time I create a new tenant. I want to share all four roles for all my tenants. Let's say I can the permissions for the "Student" role, I would have to change it for all tenants. I want all roles for tenants to have the same permission.

public static class StaticRoleNames
    {
        public static class Host
        {
            public const string Sysadmin = "Sysadmin";            
        }

        public static class Tenants
        {
            public const string Admin = "Admin";
            public const string Teacher = "Teacher";
            public const string Student = "Student";
            public const string Parent = "Parent";
        }
    }

Thank you!

Showing 1 to 9 of 9 entries