Share sink and stream in multiple screen

MainPage code ABCBloc _bloc; @override void didChangeDependencies() { _bloc = Provider.of<ABCBloc>(context, listen: false); super.didChangeDependencies(); } In one of the function in MainPage,I add list in the sink _bloc.pushNotificationSink.add(list); In PageB, I use the sink to get stream return StreamBuilder<List<String>>( stream: _bloc.pushNotificationStream, builder: (context, snapshotData) { if (snapshotData.hasData) { print(“it has data”); } else { print(“no…

Details

I need to get table row only with certain name from Firestore database but I’m stuck. Thanks

I need to get table row only with certain name from Firestore database so I’be thakful cuase I’m not very good at js and stuff. final DatabaseReference nameRef = database.getReference(“opapp”); nameRef.orderByChild(“name”).equalTo(Alexander Bol).addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String prevChildKey) { System.out.println(dataSnapshot.getKey()); }

Details

Using conditional statements in linq query c#

I have 2 queries. First gets the full name of a committee head if the committee has more that 1 member. var result = await db.ExpertCommittees .Where(f => f.Id == committeeId) .Where(f => f.ExpertCommitteeMembers.Count > 1) .Select(f => f.ExpertCommitteeMembers .Where(m => m.IsCommitteeHead) .FirstOrDefault().Expert.FullName) .FirstOrDefaultAsync(); The second one gets the full name of the only committee…

Details

Asynchronous method containing Stored Procedure

In my controller, the[POST] methods usually call a Stored Procedure from the database. I am wondering if I am doing the right thing in order to avoid concurrency issues. Take the following method as example: [HttpPost] public async Task<IActionResult> Create(Phase phase) { int releaseId = (int)TempData[“id”]; string connectionString = Configuration[“ConnectionStrings:DefaultConnection”]; using (SqlConnection connection = new…

Details