46 Questions

Priya
Priya
Member
222 Points
51 Posts
I'm trying following query: var modifiedOrders = await _applicationUnitOfWork.OrderRepository.Find(a => a.createdDate!= null && a.lastUpdated != (a.createdDate ?? DateTime.UtcNow)).SortBy(x => x.createdDate).ToListAsync(); But getting following error: EXCEPTION: Unsupported filt ...
Views: 101
Total Answered: 1
Total Marked As Answer: 0
Posted On: 26-May-2022 20:44 
 
Raj
Raj
Member
48 Points
14 Posts
I have self reference entity like as: public class Folder { public int Id { get; set; } public int ParentId { get; set; } public string Name { get; set; } } For example: class Program { static void Main(string[] args) { var l ...
Views: 115
Total Answered: 1
Total Marked As Answer: 0
Posted On: 12-May-2022 22:09 
 
beginer
beginer
270 Points
80 Posts
I'm using DateTime to create new datetime instance as: DateTime startDateUser = DateTime.UtcNow.Date.AddDays(100); while (startDateUser.Date <= DateTime.UtcNow.Date) { DateTime startDate = new DateTime(startDateUser.Year, startDateUser.Month, (startDateUser.Day - 1), 23, 59, 59); DateTime ...
Views: 232
Total Answered: 1
Total Marked As Answer: 1
Posted On: 13-Apr-2022 22:20 
 
edx
edx
150 Points
40 Posts
I'm trying following code to update items in a list as follow: class Program { static void Main(string[] args) { var strings = new List<string> { "foo", "foo" }; var list = strings.Select(x => new Foo { A = x }).ToList(); l ...
Views: 491
Total Answered: 3
Total Marked As Answer: 3
Posted On: 01-Feb-2022 02:07 
 
beginer
beginer
270 Points
80 Posts
I'm trying to connect an api which returning gzip compressed data in response. Due to this HTTP client throwing error: Doing something: public async Task<string> GetResponseString(string text) { var httpClient = new HttpClient(); var parameters = new Dictiona ...
Views: 725
Total Answered: 2
Total Marked As Answer: 2
Posted On: 08-Nov-2021 03:32 
 
mongo
mongo
6 Points
3 Posts
I have written group aggregate pile line. It was working fine. But now getting error as: Command aggregate failed: Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in..MongoDB.Driver.Core! I'm trying something: var group = new BsonDocument ...
Views: 2685
Total Answered: 2
Total Marked As Answer: 1
Posted On: 12-Oct-2021 02:43 
 
Rashmi
Rashmi
Member
182 Points
36 Posts
I'm trying following c# code to parse date with string format "yyMMdd". var provider = CultureInfo.InvariantCulture; DateTime.TryParseExact("320918", "yyMMdd", provider, DateTimeStyles.None,out var dt) It's working fine if we are putting year 29 or less as "290918". And it's parsing as "18th Se ...
Views: 563
Total Answered: 1
Total Marked As Answer: 1
Posted On: 17-Sep-2021 20:01 
 
Smith
Smith
Teacher
718 Points
154 Posts
I'm trying to generate GS1 data matrix code using https://zxing.net . I'm facing issue to generate separator and starting code.  I'm referring to doc: https://www.gs1.org/docs/barcodes/GS1_DataMatrix_Guideline.pdf var writer = new ZXing.BarcodeWriterPixelData { ...
Views: 734
Total Answered: 1
Total Marked As Answer: 1
Posted On: 21-Jul-2021 02:32 
 
beginer
beginer
270 Points
80 Posts
How to get Hours and Minutes as two digits with leading zero from DateTime object? I'm trying following code formulate the file path: var filePath = $"{DateTime.UtcNow.Year}/{DateTime.UtcNow.Month}/{DateTime.UtcNow.Day}/{DateTime.UtcNow.Hour}/{DateTime.UtcNow.Minute}/{Guid.NewGuid()}"; But it' ...
Views: 522
Total Answered: 1
Total Marked As Answer: 1
Posted On: 07-Apr-2021 06:00 
 
beginer
beginer
270 Points
80 Posts
I'm trying following code to scaling image: public static Image ScaleImage(Image image, int maxWidth, int maxHeight) { var ratioX = (double)maxWidth / image.Width; var ratioY = (double)maxHeight / image.Height; var ratio = Math.Min(ratioX, ratioY); var newWidth = (int)(image.Width * rat ...
Views: 415
Total Answered: 1
Total Marked As Answer: 1
Posted On: 16-Mar-2021 08:13 
 
 Log In to Chat