I am using AsNoTracking in GetAll() repository call in the following way:
var itemsList=await _exampleRepository.GetAll()
.AsNoTracking()
.Where(someCondition)
.Include(r=>r.Entity)
.ToListAsync()
Is this the correct way to order AsNoTracking(), Where clause and Include?
Hi ismcagdas,
ABP packages version is 0.8.3.0
Could you please tell us how to disable SignalR?
Thanks, SparkyJr
Thanks @aaron..
I have a DomainService and I want to fetch all the users for a particular tenant. I try to do that using UserManager.So inject UserManager as a dependency in the constructor and try to use _userManger.Users.ToList() . But I get an exception as "DbContext has been disposed."
We deployed our web app on azure and found that the app is performing poorly. So we ran the diagnostic test on azure, results of which is posted below.
[attachment=1:1k4949ma]Graph.png[/attachment:1k4949ma]
The diagnostic report also says that >90.91% of failures came from '/signalr/reconnect' path.
Is this something to do with Abp Notification System? If so, how can I disable the notification system?
Does the repository methods GetAsync(),GetAllListAsync() have AsNoTracking() enabled in them?
I am using repositories GetAll() method to fetch some data from the repository. But when I use [UnitOfWork(IsDisabled=true)] in controller and application service, GetAll() method is throwing an exception.
The exception that is thrown is "DbContext has been disposed."
Please suggest how to go about this issue.
Yes I am using EF 6.0.
The following is my code snippet: I am setting LazyLoadingEnabled to false in DbContext.
public ABXDbContext()
: base("Default")
{
Configuration.LazyLoadingEnabled = false;
}
public ABXDbContext(string nameOrConnectionString)
: base(nameOrConnectionString)
{
Configuration.LazyLoadingEnabled = false;
}
Here are my entities with virtual removed:
public class CascadeLevel : FullAuditedEntity, IMustHaveTenant
{
[Required]
public int TenantId { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; }
[Required]
public int Level { get; set; }
public ICollection<CascadeLevelType> CascadeLevelTypes { get; set; }
}
public class CascadeLevelType : FullAuditedEntity, IMustHaveTenant
{
[Required]
public int TenantId { get; set; }
[Required]
public int CascadeLevelId { get; set; }
public CascadeLevel CascadeLevelData { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; }
[MaxLength(500)]
public string Description { get; set; }
public string IconClass { get; set; }
public string AssociationId { get; set; } //Gaurav(1)
public ICollection<CascadeLevelTypeLabelValueRelation> CascadeLevelTypeLabelValueRelations { get; set; }
public ICollection<CascadeLevelTypeKPIRelation> CascadeLevelTypeKPIRelations { get; set; }
public ICollection<Initiative> Initiatives { get; set; }
}
private readonly IRepository<CascadeLevel> _cascadeLevelRepository;
private readonly IRepository<CascadeLevelType> _cascadeLevelTypeRepository;
public async Task<GetCascadeLevelsDto> GetAllCascadeLevels()
{
GetCascadeLevelsDto cascadeLevelsDto = new GetCascadeLevelsDto();
var allCascadeLevels = await _cascadeLevelRepository.GetAllListAsync();
var allCascadeLevelTypes = await _cascadeLevelTypeRepository.GetAllListAsync();
If I remove virtual keyword from navigation property on an entity and set LazyLoadingEnabled to false in DbContext , the loaded entity still shows navigation properties for GetAllListAsync methods from the repository. Shouldn't it be showing null for the navigation properties?