Cryy
Asynchronous batch processing (queue) in C#
Hey guys, I have some batches to process and to do so I have to send each of my batches to external APi to process. I have no experience with async programming so I simplified it a bit by using Parallel.Foreach that create thread/task for each API calling and waiting for response. The reason I dont want to call API synchronously Is that processing of one batch can take a one sec or 30min (max). With the Parallel.Foreach solution it looks it works fine but form what I read on internet it's not a good approach so I want to implement kind of async queue that will take a few items from my collection of batches starts processing and after some of them is finished replace it with another etc. I tried to came up with something using ChatGPT but it only process specified number of batches (3 in my case) and than it does nothing but even if the code is short there are lot's of new concepts for me so I have no idea how to fixed this.
22 replies
Create data during EF6 migrations
Hey guys, in our project we use some kind of "changelog implementation" to track all changes in our data. For some reason we also need to create changelongs with default values in case we add let says new columns to DB tables and I dont know what's the best way to do it. Currently I'm playing with some kind of DbCommandInterceptor that detects DB update process (applying migrations), parse them and create records accordingly but I'm not sure if that's correct approach. One of the reason I dont like it it's because it has to parse every command to DB and calculate if it is or if it's not the migration but maybe there is smarter way to do that. Any experience with it ? Thanks
8 replies
Performance question
Hey guys,
I have an web app and I tried to optimize the performance of one report. One stuff that seems unefficient to me is this one:
If I understand it correctly, it'll execute the whole query 4 (5 if I count also counting but guess it's necessary) times so I tried to do optimize it to do everything in one step like this:
but according the Network in Chrome this optimalization is even a bit slower and I cant understand why. Any explanation ? Thanks
32 replies
.NET tool/library for communication/network logging
Hye guys, I was asked to do some "research" to find some fancy/cool way to logging communication between our application and webservices, external services, stuff like that. Original idea was just log requests/responses, some data to database but It turned out not to be ideal. Is there some standard way how to achieve that, maybe some third party library u use in your projects ? I'd really appreciate some input/advice. Thank you 🙂
15 replies
❔ Docx behave differently after being rezipped
Hi,
I'm trying to convert docx file -> PDF by using some library but there is an weird issue. Final PDF is generated without one picture in footer that is present in original docx file.
But, it works correctly of I do one of these things:
1) open docx and than save it (save as) again, so new file works
2) unzip and than zip docx file to the new file by using
System.IO.Compression.ZipFile
.
In first case I can see some differences in docx unzipped xmls but in second case everything seems to be the same so I really dont understand why that make a difference.
Any idea why is that happening ?
Thanks2 replies
❔ Tabs in GemBox.Document
Hey guys, I'm "migrating" from Syncfusion to Gembox.Document and everything works fine but I have some issue with creating footer.
Our previous code for syncfusion created footer using Tabs like this:
but i dont know how to recreate this using GemBox. I'm trying it using
Run
instances but I dont how how to add SpecialCharacter to it so it does not looks like it should. Any experience with that ?
Thank you2 replies
❔ Log4Net stopped works
Hey guys, any experience with log4net ? It stopped logging to DB from version 2.0.14. I tried previous version and it works fine but after update to 2.0.14 it does log nothing to DB (works for file though). After rollback everything is ok. Any idea why ?
3 replies
❔ Free .NET library to convert Word/Excel files to PDF
Hey guys, is there any free library to convert Word/Excel files to PDF available ? Currently we are using Synfusion libraries but we are looking for something inexpensive or even free. Any ideas ? 🙂
Thanks
15 replies
❔ Sort dictionary according to the list of string (sorted keys)
Hey guys, I have a list od strings in specific order and dictionary with keys that each of keys is one of the string from the list. Is there any effective way to sort the dictionary according to the list of strings ? Thank
5 replies
Creating DataTable columns dynamically - C
Hey guys,
currently I have an implementation of jQuery DataTables that wont allow to add columns dynamically. Now I need that fhe option to generate columns based of result of Linq query (database query result) but I'm not sure how to implement repositoy method for that. It's a good idea to put these dynamic columns into Expando object ?
Thanks
1 replies
Parsing string to TimeSpan
Hey guys, I'm trying to parse some string to TimeSpan . Input string is "01:02:01" and I'm trying it to parse to TimeSpan structure like this
TimeSpan.ParseExact(inputString, "dd:hh:mm", CultureInfo.InvariantCulture)
(expecting days:hours:minutes) but I got "Input string was not in a correct format." exception. What I'm doing wrong ? Thanks18 replies