@ismcagdas - Thanks! Question: I had created my own custom "bundles" for a group of scripts I use across many of my pages. How do I get that added/working?
@maliming, @nicolaslau - Thanks for the help! I added the below and it worked perfectly!
"create-bundles-dev": "webpack --progress --profile --mode=development",
I added all the "custom" bundles for my app into the bundles.json (see below) file (I copied and updated them from my V6.8 solution), however after the "create-bundles" runs I'm not seeing my bundles created? Do I need to do something additional?
"myAppScripts": [
{
"outputFolder": "wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.min.js",
"input": [
"wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.js"
],
///Code removed for brevity
}
@aaron - Thanks! Your last answer along with the original article helped solve my issue!
Here you go.
protected int? CurrentCompanyId = null;
protected int? CurrentNurseHomeId = null;
protected bool IsCompanyFilterEnabled => CurrentCompanyId != null && CurrentUnitOfWorkProvider?.Current?.IsFilterEnabled("CompanyFilter") == true;
protected bool IsNurseHomeFilterEnabled => CurrentNurseHomeId != null && CurrentUnitOfWorkProvider?.Current?.IsFilterEnabled("NurseHomeFilter") == true;
@aaron - Thanks! I noticed those differences just after I posted my last message. I applied those changes, but the filtering is still not working.
protected override bool ShouldFilterEntity<TEntity>(IMutableEntityType entityType)
{
if (typeof(IHasCompany).IsAssignableFrom(typeof(TEntity)))
{
return true;
}
if (typeof(IHasNurseHome).IsAssignableFrom(typeof(TEntity)))
{
return true;
}
return base.ShouldFilterEntity<TEntity>(entityType);
}
protected override Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>()
{
var expression = base.CreateFilterExpression<TEntity>();
if (typeof(IHasCompany).IsAssignableFrom(typeof(TEntity)))
{
Expression<Func<TEntity, bool>> companyFilter = e => ((IHasCompany)e).CompanyId == CurrentCompanyId || (((IHasCompany)e).CompanyId == CurrentCompanyId) == IsCompanyFilterEnabled;
expression = expression == null ? companyFilter : CombineExpressions(expression, companyFilter);
}
if (typeof(IHasNurseHome).IsAssignableFrom(typeof(TEntity)))
{
Expression<Func<TEntity, bool>> nurseHomeFilter = e => ((IHasNurseHome)e).NurseHomeId == CurrentNurseHomeId || (((IHasNurseHome)e).NurseHomeId == CurrentNurseHomeId) == IsCompanyFilterEnabled;
expression = expression == null ? nurseHomeFilter : CombineExpressions(expression, nurseHomeFilter);
}
return expression;
}
Here in debug you can see that both filter are enabled and have values.
I have just updated my solution V6.8 now and this data filtering is still not working for me.
Here on the Index view app service method, at the very first using statement, you can see the immediate window shows that both filters are enabled.
Here are the methods, which are in my base app service class, that get the current user company and home values. In this test, you can see both values are populated.
Yet when the code in the method executes, the query still returns all rows in the result?
Thanks!
I had to delete the entire .Web.Mvc\wwwroot\assets\Jcrop\src folder. As I see that folder no longer exists in your solution.
I just checked the AspNetZero solution code in the AspNetZero teams GIT Repo and applied the below change in all the classes that were reporting the error and build is now successfull. I hope this was the proper fix?
I removed the using statement (using EXLNT.CareOps.Configuration.Dto) from:
Bump.
Has anyone been able to get this to work? I really would prefer to test against a live DB. The in-memory DB testing is not realistic. As my application is advancing and more tables are introduced, I would have to create so many data entries into the "Databuilder" class. Plus worry about all the FK relationships. It's just not practical.