Click here to Skip to main content
15,911,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: push notification from android c# Pin
OriginalGriff28-Dec-19 22:24
mveOriginalGriff28-Dec-19 22:24 
GeneralRe: push notification from android c# Pin
Richard MacCutchan28-Dec-19 22:26
mveRichard MacCutchan28-Dec-19 22:26 
GeneralRe: push notification from android c# Pin
Member 477398728-Dec-19 23:02
Member 477398728-Dec-19 23:02 
QuestionUDP Hole Punching not Work Pin
DioCarvalho24-Dec-19 9:24
professionalDioCarvalho24-Dec-19 9:24 
AnswerRe: TCP Hole Punching not Work Pin
Gerry Schmitz24-Dec-19 11:27
mveGerry Schmitz24-Dec-19 11:27 
GeneralRe: TCP Hole Punching not Work Pin
DioCarvalho24-Dec-19 11:40
professionalDioCarvalho24-Dec-19 11:40 
AnswerRe: TCP Hole Punching not Work Pin
phil.o24-Dec-19 23:16
professionalphil.o24-Dec-19 23:16 
GeneralRe: TCP Hole Punching not Work Pin
DioCarvalho25-Dec-19 6:15
professionalDioCarvalho25-Dec-19 6:15 
GeneralRe: TCP Hole Punching not Work Pin
phil.o25-Dec-19 6:22
professionalphil.o25-Dec-19 6:22 
GeneralRe: TCP Hole Punching not Work Pin
DioCarvalho25-Dec-19 6:57
professionalDioCarvalho25-Dec-19 6:57 
GeneralRe: TCP Hole Punching not Work Pin
Gerry Schmitz26-Dec-19 6:24
mveGerry Schmitz26-Dec-19 6:24 
GeneralRe: TCP Hole Punching not Work Pin
DioCarvalho26-Dec-19 12:53
professionalDioCarvalho26-Dec-19 12:53 
QuestionLists basics Pin
_Q12_23-Dec-19 16:46
_Q12_23-Dec-19 16:46 
AnswerRe: Lists basics Pin
OriginalGriff23-Dec-19 20:28
mveOriginalGriff23-Dec-19 20:28 
AnswerRe: Lists basics Pin
Gerry Schmitz24-Dec-19 5:04
mveGerry Schmitz24-Dec-19 5:04 
QuestionMongoDB, c# driver, ElemMatch an array within an array Pin
jkirkerx19-Dec-19 10:12
professionaljkirkerx19-Dec-19 10:12 
Perhaps this is poor planing on my part, a bad document model but I thought it was the right way to go. I'm trying to find "US" and "AK" in a collection of Mongo Documents that represent ship rates. I have a collection of Ship Rate documents that look like this.
{
  "Carrier" : "USPS",
  "US Mail First Class Package",
  "Countries" : [
    {
      "Name" : "United States",
      "Abbr" : "US",
      "States" : [
         "AL",
         "AK",
         "More states ..."
      ],
      "Name" : "Canada",
      "Abbr" : "CA",
      "States" : [
        "BC",
        "ON"
      ]     
    }
}
With this code in my repository, I can get all the documents with "US" in countries, but I want to go one step further and qualify the state as well, in case I don't want to ship to Hawaii.
var results = new List<QuotedShipRates>();
var filter1 = Builders<WEBSITE_SHIPSERVICES>.Filter
    .ElemMatch(c => c.Countries, c => c.Abbr == countryCode);                
var shipRates = await _context.WebsiteShipServices.Find(filter1).ToListAsync();

foreach (var shipRate in shipRates)
{
    results.Add(new QuotedShipRates()
    {
        Name = shipRate.Name,
        Code = shipRate.Code,
        Rate = 5.99M,
        GuaranteedDate = DateTime.Now.AddDays(5)
    });
}  
I just can't figure out how to get deeper here, to go to the array within the array.
I wanted to make this AsQueryable at first, but couldn't figure out how to write an expression for it.

I'm aware Canada has provinces, and Japan has prefectures, etc. I don't know what else to call states at the moment. LOL Smile | :)
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: MongoDB, c# driver, ElemMatch an array within an array Pin
#realJSOP23-Dec-19 0:43
professional#realJSOP23-Dec-19 0:43 
GeneralRe: MongoDB, c# driver, ElemMatch an array within an array Pin
jkirkerx23-Dec-19 6:42
professionaljkirkerx23-Dec-19 6:42 
AnswerRe: MongoDB, c# driver, ElemMatch an array within an array [solved] Pin
jkirkerx23-Dec-19 7:10
professionaljkirkerx23-Dec-19 7:10 
QuestionImage deblur Pin
Member 1318127618-Dec-19 9:48
Member 1318127618-Dec-19 9:48 
AnswerRe: Image deblur Pin
OriginalGriff18-Dec-19 9:53
mveOriginalGriff18-Dec-19 9:53 
AnswerRe: Image deblur Pin
Richard MacCutchan18-Dec-19 21:26
mveRichard MacCutchan18-Dec-19 21:26 
QuestionVFPOLEDB Encoding issue Pin
pepl8016-Dec-19 12:40
pepl8016-Dec-19 12:40 
AnswerRe: VFPOLEDB Encoding issue Pin
Dave Kreskowiak16-Dec-19 13:48
mveDave Kreskowiak16-Dec-19 13:48 
GeneralRe: VFPOLEDB Encoding issue Pin
pepl8016-Dec-19 23:32
pepl8016-Dec-19 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.