Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "Astech"

That's worked, many thanks @ismcagdas

We have the following background job:

class BuildAgendaJob : ITransientDependency
{
	private readonly IAppNotifier _appNotifier;
	private readonly IAgendasAppService _agendasAppService;
	private readonly IDocumentsAppService _documentsAppService;
	private readonly IHubContext<BuildProgressHub> _buildProgressHub;
	private readonly IAbpSession _session;
	private readonly IRepository<Agenda> _agendaRepository;
	private readonly IUnitOfWorkManager _unitOfWorkManager;

	public BuildAgendaJob(IAppNotifier appNotifier,
							IAgendasAppService agendasAppService,
							IHubContext<BuildProgressHub> buildProgressHub,
							IAbpSession session,
							IRepository<Agenda> agendaRepository,
							IDocumentsAppService documentsAppService,
							IUnitOfWorkManager unitOfWorkManager)
	{
		_appNotifier = appNotifier;
		_agendasAppService = agendasAppService;
		_buildProgressHub = buildProgressHub;
		_session = session;
		_agendaRepository = agendaRepository;
		_documentsAppService = documentsAppService;
		_unitOfWorkManager = unitOfWorkManager;
	}

	public async Task BuildAgenda(BuildAgendaJobArgs args, CancellationToken token)
	{
		using (var uow = _unitOfWorkManager.Begin())
		{
			// Set tenant Id
			_unitOfWorkManager.Current.SetTenantId(args.TenantId);

			// Run the job with the same permissions as the person that started it
			using (_session.Use(args.TenantId, args.UserId))
			{
				try
				{
					await _agendasAppService.AddAgendaDocument(
						new AddAgendaDocumentDto
						{
							AgendaId = args.AgendaId,
							FileName = "Agenda.docx",
						});

					//Notify the UI
					await _buildProgressHub.Clients.All.SendAsync("AgendaBuildFinished" + args.AgendaId);

					// Notify the user
					AsyncHelper.RunSync(() => _appNotifier.AgendaBuiltAsync(args));
				}
				catch (OperationCanceledException)
				{
					await _buildProgressHub.Clients.All.SendAsync("AgendaBuildFinished" + args.AgendaId);
					return;
				}
				catch (Exception ex)
				{
					//TODO
				}
			}
		}
	}
}

<br> As you can see above, it calls:

_agendasAppService.AddAgendaDocument

Which inserts the new record into the database. It appears to be working as in that method it returns the next available id in the database after its insert. However, the database does not get updated. Is as if the code has inserted the record but it has not pushed the changes to EF/database.

I have attempted to add: <br>

await _unitOfWorkManager.Current.SaveChangesAsync();

at the end of the background job however the record does still not get pushed to the database.

Am I missing something? Usually the app service will push any changes to the dbcontext automatically. Why is this not the case here?

Thanks

Hi @ismcagdas,

I have tried both solutions and still get the same error.

C:\Repos\Congresso\src\Congresso.Web.Mvc>npm install yarn npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/bootstrap npm ERR! bootstrap@"4.3.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer bootstrap@"^3.1.1" from [email protected] npm ERR! node_modules/bootstrap-switch npm ERR! bootstrap-switch@"3.3.4" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\JRadu\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\JRadu\AppData\Local\npm-cache_logs\2021-04-29T09_35_41_213Z-debug.log

Here is the log:

0 verbose cli [ 0 verbose cli 'C:\Program Files\nodejs\node.exe', 0 verbose cli 'C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 0 verbose cli 'install', 0 verbose cli 'yarn' 0 verbose cli ] 1 info using [email protected] 2 info using [email protected] 3 timing npm:load:whichnode Completed in 1ms 4 timing config:load:defaults Completed in 2ms 5 timing config:load:file:C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms 6 timing config:load:builtin Completed in 2ms 7 timing config:load:cli Completed in 1ms 8 timing config:load:env Completed in 1ms 9 timing config:load:file:C:\Repos\Congresso\src\Congresso.Web.Mvc.npmrc Completed in 1ms 10 timing config:load:project Completed in 1ms 11 timing config:load:file:C:\Users\JRadu.npmrc Completed in 0ms 12 timing config:load:user Completed in 0ms 13 timing config:load:file:C:\Users\JRadu\AppData\Roaming\npm\etc\npmrc Completed in 0ms 14 timing config:load:global Completed in 1ms 15 timing config:load:validate Completed in 0ms 16 timing config:load:credentials Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 10ms 19 timing npm:load:configload Completed in 10ms 20 timing npm:load:setTitle Completed in 0ms 21 timing npm:load:setupLog Completed in 2ms 22 timing npm:load:cleanupLog Completed in 2ms 23 timing npm:load:configScope Completed in 0ms 24 timing npm:load:projectScope Completed in 1ms 25 timing npm:load Completed in 18ms 26 timing config:load:flatten Completed in 3ms 27 timing arborist:ctor Completed in 1ms 28 timing idealTree:init Completed in 14ms 29 timing idealTree:userRequests Completed in 2ms 30 silly idealTree buildDeps 31 silly fetch manifest @types/node@^12.7.4 32 http fetch GET 304 https://registry.npmjs.org/@types%2fnode 661ms (from cache) 33 silly fetch manifest globby@^9.2.0 34 http fetch GET 304 https://registry.npmjs.org/globby 81ms (from cache) 35 silly fetch manifest gulp@^4.0.1 36 http fetch GET 304 https://registry.npmjs.org/gulp 137ms (from cache) 37 silly fetch manifest gulp-clean-css@^4.2.0 38 http fetch GET 304 https://registry.npmjs.org/gulp-clean-css 57ms (from cache) 39 silly fetch manifest gulp-concat@^2.6.1 40 http fetch GET 304 https://registry.npmjs.org/gulp-concat 79ms (from cache) 41 silly fetch manifest gulp-less@^4.0.1 42 http fetch GET 200 https://registry.npmjs.org/gulp-less 6ms (from cache) 43 silly fetch manifest gulp-postcss@^8.0.0 44 http fetch GET 304 https://registry.npmjs.org/gulp-postcss 52ms (from cache) 45 silly fetch manifest gulp-uglify-es@^1.0.4 46 http fetch GET 304 https://registry.npmjs.org/gulp-uglify-es 62ms (from cache) 47 silly fetch manifest merge-stream@^2.0.0 48 http fetch GET 304 https://registry.npmjs.org/merge-stream 56ms (from cache) 49 silly fetch manifest postcss-url@^9.0.0 50 http fetch GET 304 https://registry.npmjs.org/postcss-url 83ms (from cache) 51 silly fetch manifest rimraf@^3.0.0 52 http fetch GET 304 https://registry.npmjs.org/rimraf 128ms (from cache) 53 silly fetch manifest yarn@^1.15.0 54 http fetch GET 304 https://registry.npmjs.org/yarn 66ms (from cache) 55 silly fetch manifest @fancyapps/fancybox@^3.5.7 56 http fetch GET 200 https://registry.npmjs.org/@fancyapps%2ffancybox 6ms (from cache) 57 silly fetch manifest jquery@^3.3.1 58 http fetch GET 304 https://registry.npmjs.org/jquery 72ms (from cache) 59 silly fetch manifest @fortawesome/fontawesome-free@^5.8.1 60 http fetch GET 304 https://registry.npmjs.org/@fortawesome%2ffontawesome-free 227ms (from cache) 61 silly fetch manifest @microsoft/signalr@^3.1.2 62 http fetch GET 304 https://registry.npmjs.org/@microsoft%2fsignalr 901ms (from cache) 63 silly fetch manifest [email protected] 64 http fetch GET 200 https://registry.npmjs.org/abp-web-resources 4ms (from cache) 65 silly fetch manifest animate.css@^3.7.0 66 http fetch GET 200 https://registry.npmjs.org/animate.css 4ms (from cache) 67 silly fetch manifest autosize@^4.0.2 68 http fetch GET 304 https://registry.npmjs.org/autosize 51ms (from cache) 69 silly fetch manifest block-ui@^2.70.1 70 http fetch GET 200 https://registry.npmjs.org/block-ui 2ms (from cache) 71 silly fetch manifest blueimp-file-upload@^10.2.0 72 http fetch GET 200 https://registry.npmjs.org/blueimp-file-upload 2ms (from cache) 73 silly fetch manifest [email protected] 74 http fetch GET 304 https://registry.npmjs.org/bootstrap 74ms (from cache) 75 silly fetch manifest popper.js@^1.14.7 76 http fetch GET 304 https://registry.npmjs.org/popper.js 759ms (from cache) 77 silly fetch manifest bootstrap-daterangepicker@^3.0.3 78 http fetch GET 200 https://registry.npmjs.org/bootstrap-daterangepicker 3ms (from cache) 79 silly fetch manifest bootstrap-hover-dropdown@^2.2.1 80 http fetch GET 200 https://registry.npmjs.org/bootstrap-hover-dropdown 2ms (from cache) 81 silly fetch manifest bootstrap-markdown@^2.10.0 82 http fetch GET 200 https://registry.npmjs.org/bootstrap-markdown 2ms (from cache) 83 silly fetch manifest bootstrap-maxlength@^1.6.0 84 http fetch GET 200 https://registry.npmjs.org/bootstrap-maxlength 3ms (from cache) 85 silly fetch manifest bootstrap-notify@^3.1.3 86 http fetch GET 200 https://registry.npmjs.org/bootstrap-notify 3ms (from cache) 87 silly fetch manifest bootstrap-select@^1.13.9 88 http fetch GET 200 https://registry.npmjs.org/bootstrap-select 5ms (from cache) 89 silly fetch manifest [email protected] 90 http fetch GET 200 https://registry.npmjs.org/bootstrap-switch 4ms (from cache) 91 silly fetch manifest bootstrap@^3.1.1 92 timing idealTree Completed in 3691ms 93 timing command:install Completed in 3700ms 94 verbose stack Error: unable to resolve dependency tree 94 verbose stack at Arborist.[failPeerConflict] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1220:25) 94 verbose stack at Arborist.[loadPeerSet] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1187:34) 94 verbose stack at async Arborist.[buildDepStep] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:891:11) 94 verbose stack at async Arborist.buildIdealTree (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:217:7) 94 verbose stack at async Promise.all (index 1) 94 verbose stack at async Arborist.reify (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:135:5) 94 verbose stack at async Install.install (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\lib\install.js:137:5) 95 verbose cwd C:\Repos\Congresso\src\Congresso.Web.Mvc 96 verbose Windows_NT 10.0.19042 97 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "yarn" 98 verbose node v16.0.0 99 verbose npm v7.11.1 100 error code ERESOLVE 101 error ERESOLVE unable to resolve dependency tree 102 error 103 error While resolving: abpzerotemplate@10.0.0 103 error Found: bootstrap@4.3.1 103 error node_modules/bootstrap 103 error bootstrap@"4.3.1" from the root project 103 error 103 error Could not resolve dependency: 103 error peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4 103 error node_modules/bootstrap-switch 103 error bootstrap-switch@"3.3.4" from the root project 103 error 103 error Fix the upstream dependency conflict, or retry 103 error this command with --force, or --legacy-peer-deps 103 error to accept an incorrect (and potentially broken) dependency resolution. 103 error 103 error See C:\Users\JRadu\AppData\Local\npm-cache\eresolve-report.txt for a full report. 104 verbose exit 1

0 verbose cli [ 0 verbose cli 'C:\Program Files\nodejs\node.exe', 0 verbose cli 'C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 0 verbose cli 'install' 0 verbose cli ] 1 info using [email protected] 2 info using [email protected] 3 timing npm:load:whichnode Completed in 2ms 4 timing config:load:defaults Completed in 1ms 5 timing config:load:file:C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 2ms 6 timing config:load:builtin Completed in 2ms 7 timing config:load:cli Completed in 1ms 8 timing config:load:env Completed in 1ms 9 timing config:load:file:C:\Repos\Congresso\src\Congresso.Web.Mvc.npmrc Completed in 1ms 10 timing config:load:project Completed in 1ms 11 timing config:load:file:C:\Users\JRadu.npmrc Completed in 1ms 12 timing config:load:user Completed in 1ms 13 timing config:load:file:C:\Users\JRadu\AppData\Roaming\npm\etc\npmrc Completed in 0ms 14 timing config:load:global Completed in 0ms 15 timing config:load:validate Completed in 1ms 16 timing config:load:setEnvs Completed in 0ms 17 timing config:load Completed in 8ms 18 timing npm:load:configload Completed in 8ms 19 timing npm:load:setTitle Completed in 1ms 20 timing npm:load:setupLog Completed in 2ms 21 timing npm:load:cleanupLog Completed in 2ms 22 timing npm:load:configScope Completed in 0ms 23 timing npm:load:projectScope Completed in 1ms 24 timing npm:load Completed in 16ms 25 timing config:load:flatten Completed in 2ms 26 timing arborist:ctor Completed in 0ms 27 timing idealTree:init Completed in 27ms 28 timing idealTree:userRequests Completed in 1ms 29 silly idealTree buildDeps 30 silly fetch manifest @types/node@^12.7.4 31 http fetch GET 304 https://registry.npmjs.org/@types%2fnode 703ms (from cache) 32 silly fetch manifest globby@^9.2.0 33 http fetch GET 304 https://registry.npmjs.org/globby 62ms (from cache) 34 silly fetch manifest gulp@^4.0.1 35 http fetch GET 304 https://registry.npmjs.org/gulp 72ms (from cache) 36 silly fetch manifest gulp-clean-css@^4.2.0 37 http fetch GET 304 https://registry.npmjs.org/gulp-clean-css 107ms (from cache) 38 silly fetch manifest gulp-concat@^2.6.1 39 http fetch GET 304 https://registry.npmjs.org/gulp-concat 55ms (from cache) 40 silly fetch manifest gulp-less@^4.0.1 41 http fetch GET 304 https://registry.npmjs.org/gulp-less 61ms (from cache) 42 silly fetch manifest gulp-postcss@^8.0.0 43 http fetch GET 304 https://registry.npmjs.org/gulp-postcss 63ms (from cache) 44 silly fetch manifest gulp-uglify-es@^1.0.4 45 http fetch GET 304 https://registry.npmjs.org/gulp-uglify-es 63ms (from cache) 46 silly fetch manifest merge-stream@^2.0.0 47 http fetch GET 304 https://registry.npmjs.org/merge-stream 75ms (from cache) 48 silly fetch manifest postcss-url@^9.0.0 49 http fetch GET 304 https://registry.npmjs.org/postcss-url 59ms (from cache) 50 silly fetch manifest rimraf@^3.0.0 51 http fetch GET 304 https://registry.npmjs.org/rimraf 67ms (from cache) 52 silly fetch manifest yarn@^1.15.0 53 http fetch GET 304 https://registry.npmjs.org/yarn 93ms (from cache) 54 silly fetch manifest @fancyapps/fancybox@^3.5.7 55 http fetch GET 304 https://registry.npmjs.org/@fancyapps%2ffancybox 174ms (from cache) 56 silly fetch manifest jquery@^3.3.1 57 http fetch GET 304 https://registry.npmjs.org/jquery 86ms (from cache) 58 silly fetch manifest @fortawesome/fontawesome-free@^5.8.1 59 http fetch GET 304 https://registry.npmjs.org/@fortawesome%2ffontawesome-free 194ms (from cache) 60 silly fetch manifest @microsoft/signalr@^3.1.2 61 http fetch GET 304 https://registry.npmjs.org/@microsoft%2fsignalr 142ms (from cache) 62 silly fetch manifest [email protected] 63 http fetch GET 304 https://registry.npmjs.org/abp-web-resources 67ms (from cache) 64 silly fetch manifest animate.css@^3.7.0 65 http fetch GET 304 https://registry.npmjs.org/animate.css 66ms (from cache) 66 silly fetch manifest autosize@^4.0.2 67 http fetch GET 304 https://registry.npmjs.org/autosize 73ms (from cache) 68 silly fetch manifest block-ui@^2.70.1 69 http fetch GET 304 https://registry.npmjs.org/block-ui 68ms (from cache) 70 silly fetch manifest blueimp-file-upload@^10.2.0 71 http fetch GET 304 https://registry.npmjs.org/blueimp-file-upload 88ms (from cache) 72 silly fetch manifest [email protected] 73 http fetch GET 304 https://registry.npmjs.org/bootstrap 64ms (from cache) 74 silly fetch manifest popper.js@^1.14.7 75 http fetch GET 304 https://registry.npmjs.org/popper.js 70ms (from cache) 76 silly fetch manifest bootstrap-daterangepicker@^3.0.3 77 http fetch GET 304 https://registry.npmjs.org/bootstrap-daterangepicker 109ms (from cache) 78 silly fetch manifest bootstrap-hover-dropdown@^2.2.1 79 http fetch GET 304 https://registry.npmjs.org/bootstrap-hover-dropdown 789ms (from cache) 80 silly fetch manifest bootstrap-markdown@^2.10.0 81 http fetch GET 304 https://registry.npmjs.org/bootstrap-markdown 79ms (from cache) 82 silly fetch manifest bootstrap-maxlength@^1.6.0 83 http fetch GET 304 https://registry.npmjs.org/bootstrap-maxlength 842ms (from cache) 84 silly fetch manifest bootstrap-notify@^3.1.3 85 http fetch GET 304 https://registry.npmjs.org/bootstrap-notify 85ms (from cache) 86 silly fetch manifest bootstrap-select@^1.13.9 87 http fetch GET 304 https://registry.npmjs.org/bootstrap-select 89ms (from cache) 88 silly fetch manifest [email protected] 89 http fetch GET 304 https://registry.npmjs.org/bootstrap-switch 103ms (from cache) 90 silly fetch manifest bootstrap@^3.1.1 91 timing idealTree Completed in 4791ms 92 timing command:install Completed in 4800ms 93 verbose stack Error: unable to resolve dependency tree 93 verbose stack at Arborist.[failPeerConflict] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1210:25) 93 verbose stack at Arborist.[loadPeerSet] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:1187:34) 93 verbose stack at async Arborist.[buildDepStep] (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:891:11) 93 verbose stack at async Arborist.buildIdealTree (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\build-ideal-tree.js:217:7) 93 verbose stack at async Promise.all (index 1) 93 verbose stack at async Arborist.reify (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\reify.js:134:5) 93 verbose stack at async Install.install (C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\lib\install.js:137:5) 94 verbose cwd C:\Repos\Congresso\src\Congresso.Web.Mvc 95 verbose Windows_NT 10.0.19042 96 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\JRadu\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" 97 verbose node v14.16.1 98 verbose npm v7.10.0 99 error code ERESOLVE 100 error ERESOLVE unable to resolve dependency tree 101 error 102 error While resolving: abpzerotemplate@10.0.0 102 error Found: bootstrap@4.3.1 102 error node_modules/bootstrap 102 error bootstrap@"4.3.1" from the root project 102 error 102 error Could not resolve dependency: 102 error peer bootstrap@"^3.1.1" from bootstrap-switch@3.3.4 102 error node_modules/bootstrap-switch 102 error bootstrap-switch@"3.3.4" from the root project 102 error 102 error Fix the upstream dependency conflict, or retry 102 error this command with --force, or --legacy-peer-deps 102 error to accept an incorrect (and potentially broken) dependency resolution. 102 error 102 error See C:\Users\JRadu\AppData\Local\npm-cache\eresolve-report.txt for a full report. 103 verbose exit 1

Hi, I'm unable to run "npm install" or "yarn" in my MVC project.

I tried running this with a fresh copy of node.js.

`C:\Repos\Congresso\src\Congresso.Web.Mvc>npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/bootstrap npm ERR! bootstrap@"4.3.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer bootstrap@"^3.1.1" from [email protected] npm ERR! node_modules/bootstrap-switch npm ERR! bootstrap-switch@"3.3.4" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See C:\Users\JRadu\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\JRadu\AppData\Local\npm-cache_logs\2021-04-21T10_10_38_671Z-debug.log`

Perfect! Many thanks :)

We are using Hangfire to run a long running job. When the job is finished we require it to update a column in the database:

public override void Execute(BuildLogJobArgs args)
{
    using (CurrentUnitOfWork.SetTenantId(args.TenantId))
    {
        var itemsCount = 100;
        for (int i = 0; i <= itemsCount; i++)
        {
            //Simulating work
            System.Threading.Thread.Sleep(100);
            SendProgress(i, itemsCount);
        }
        // Send notification to user.
        AsyncHelper.RunSync(() => _appNotifier.LogBuiltAsync(args));

        //Finish the job
        AsyncHelper.RunSync(() => _logsAppService.FinishBuildLog(args.LogId));
    }
}

_logsAppService.FinishBuildLog_logsAppService.FinishBuildLog is responsible for updating the database. However when run we are getting:

Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!

The FinishBuildLog method is protected with [AbpAuthorize....] and we want this to continue to be the case for obvious security reasons.

In which case how can we allow the running job the same permissions to the app service that the user that started the job would have? We do have the User object available to us in the BuildLogJobArgs.

Or is there a better way to go about this?

Thanks,

Scott

Hi,

When I include the ContentPage.BindingContext on my page, the app crashes when trying to load the page.

`

<ContentPage.BindingContext>
    <local:TeamsView />
</ContentPage.BindingContext>

` I'm trying to use OpenContextMenu command which is a command inside my viewmodel.

`

    <Button Text="{StaticResource VerticalEllipsisIcon}"
        FontFamily="{StaticResource IconsFont}"
        Command="{Binding BindingContext.OpenContextMenuCommand}"
        CommandParameter="{Binding}"
        TextColor="DarkGray"
        BackgroundColor="Transparent"
        VerticalOptions="Center"

The viewmodel command: public TeamsViewModel(ITeamsAppService teamsAppService) { _teamsAppService = teamsAppService;

        OpenContextMenuCommand = new Command<TeamModel>(item => item.IsPopupOpen = !item.IsPopupOpen);
        Teams = new ObservableRangeCollection<TeamModel>();
    }

    public Command<TeamModel> OpenContextMenuCommand { get; }

`

  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .NET Core

Hi,

Does this mean there is no way to clear existing cache through the app using the memory cache?

Hi ismcagdas,

I have found a workaround which is to mark the field as readonly instead of disabled. This then allows the required attribute work.

Thanks

Showing 61 to 70 of 77 entries