Hi
I try to get the list of user in a role with this code but not work
var roleGlobal = await _roleManager.Roles.FirstOrDefaultAsync(t => t.Name == StaticRoleNames.Tenants.Manager);
var users = await UserManager.Users.Where(
t => t.Roles.All(q => q.RoleId == roleGlobal.Id && q.UserId == t.Id)).ToListAsync();
this is the full code
private void CreateDefaultTemplate()
{
var tenants = _context.Tenants.ToList();
var allFeature = _context.TenantFeatureSettings.ToList();
foreach (var tenant in tenants)
{
foreach (var featureSetting in allFeature.Where(t=> t.TenantId == tenant.Id).ToList() )
{
foreach (var template in InitialTemplates)
{
if (featureSetting.Name == template.ApplicationName)
{
template.TenantId = tenant.Id;
AddTemplateIfNotExists(template);
}
}
}
}
}
I try to add some static data on Seed method but I want to add row only if a feature is enable. I try but I not find how can get feature from database if i call
var featureSetting in allFeature.Where(t=> t.TenantId == tenant.Id).ToList()
it's always empty
I use version ui-grid - v3.2.9
but is strnage because it's happen in some case not always. I define column in js like other grind in app angular class and add data on init method calling a webapi in success return. so is posssibile the problme i releted to success()( insted of then()?
Hi
to solve this issue I use this code
if (abp.localization.currentLanguage.name !== moment.locale()) {
moment.locale(abp.localization.currentLanguage.name);
console.log(moment.locale());
}
in a ui-grid I don't have anything of strange { name: abp.localization.tmk('HolidayStart'), field: 'holiday.from', cellFilter: 'momentFormat:'llll'', width: '*' },
and is in english format
in a modal I do the same fix with code on second row of js
moment.locale(abp.localization.currentLanguage.name);
Hi
I a grid view in some case the render show only a subset off column until a do resize event. Any idea?
Hi
if you user Redis try to empty redis cache.
mat
Thank for your replay @hikalkan.
Ok I need to change my approch and use IOC from manager without do it on static class.
mat
I have a strange situation.
I a page with ui-grid I see that the column header will be localized in correct way but date inside page not. I make an example: page are setted in italian 1 load page show my header in intlian but row show me date in English (I check that abp language var are in italian) 2 load i do with f5 row are localized in italian
I see a similar issue on a pop up when I inject agular-datetime-picker via oclazyload and i solve put on 1st row
moment.locale(abp.localization.currentLanguage.name);
I think depend off some angular problem but I'm not sure any idea or similar issue? mat
Is possible to access to a entity (via manager) in a static class?
I have a method and I make a static extension if I want to give data from data base is possibile to do that? How?
mattia