Click here to Skip to main content
15,888,968 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSub Level Hyperlink not showing in asp.net Pin
Member 1115418828-Aug-18 19:13
Member 1115418828-Aug-18 19:13 
AnswerRe: Sub Level Hyperlink not showing in asp.net Pin
dan!sh 28-Aug-18 20:55
professional dan!sh 28-Aug-18 20:55 
GeneralRe: Sub Level Hyperlink not showing in asp.net Pin
Member 1115418828-Aug-18 21:04
Member 1115418828-Aug-18 21:04 
GeneralRe: Sub Level Hyperlink not showing in asp.net Pin
dan!sh 28-Aug-18 21:09
professional dan!sh 28-Aug-18 21:09 
QuestionHow to publish more than one webapps from visual studio in single click Pin
Dominic Louis27-Aug-18 20:12
Dominic Louis27-Aug-18 20:12 
Question.Net Core 2.1, MongoDB, add states collection to country states collection Pin
jkirkerx24-Aug-18 12:31
professionaljkirkerx24-Aug-18 12:31 
Question.Net Core 2.1, seeding a MongoDB, foreach on Countries, Pin
jkirkerx24-Aug-18 9:47
professionaljkirkerx24-Aug-18 9:47 
AnswerRe: .Net Core 2.1, seeding a MongoDB, foreach on Countries, [sort of solved] Pin
jkirkerx24-Aug-18 10:25
professionaljkirkerx24-Aug-18 10:25 
I have a states collection now in MongoDB
I sort of get it now. _ => true must be a wildcard like *, generate a list of countries, as a Result, now I can do the old school loop, which I needed in case I had to walk the code. There was .ForEach(country => { // do work } which did a single execution that may be more efficient.
Ended up with this ...
public static async Task SeedAsync(IMongoDatabase _database)
{
    var websiteStates = _database.GetCollection<WEBSITE_STATES>("Website_States");

    // Check and see if we have any website users
    double totalDocuments = websiteStates.CountDocuments(FilterDefinition<WEBSITE_STATES>.Empty);
    if (totalDocuments == 0)
    {

        var websiteCountries = _database.GetCollection<WEBSITE_COUNTRIES>("Website_Countries");
        try
        {<br />
            foreach (var country in websiteCountries.FindSync(_ => true).ToListAsync().Result)
            {
                switch (country.ShortName)
                {
                    // United States
                    case "US":

                        // A
                        ObjectId US_AL_Id = ObjectId.GenerateNewId();
                        var state_AL = new WEBSITE_STATES() { Id = US_AL_Id, DisplayId = US_AL_Id.ToString(), CountryId = country.DisplayId,        CountryCode = country.ShortName, LongName = "Alabama", ShortName = "AL", Enabled = true };
                        await websiteStates.InsertOneAsync(state_AL);
If it ain't broke don't fix it
Discover my world at jkirkerx.com

General[solved] Pin
jkirkerx27-Aug-18 7:59
professionaljkirkerx27-Aug-18 7:59 
QuestionAccess HttpContext in ASP.NET Core Pin
JimFeng22-Aug-18 6:35
JimFeng22-Aug-18 6:35 
AnswerRe: Access HttpContext in ASP.NET Core Pin
Vincent Maverick Durano22-Aug-18 8:40
professionalVincent Maverick Durano22-Aug-18 8:40 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng23-Aug-18 5:07
JimFeng23-Aug-18 5:07 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Vincent Maverick Durano23-Aug-18 7:42
professionalVincent Maverick Durano23-Aug-18 7:42 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng23-Aug-18 8:39
JimFeng23-Aug-18 8:39 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Vincent Maverick Durano23-Aug-18 10:28
professionalVincent Maverick Durano23-Aug-18 10:28 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming23-Aug-18 9:14
mveRichard Deeming23-Aug-18 9:14 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng24-Aug-18 9:21
JimFeng24-Aug-18 9:21 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming28-Aug-18 2:02
mveRichard Deeming28-Aug-18 2:02 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng28-Aug-18 7:09
JimFeng28-Aug-18 7:09 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming28-Aug-18 7:16
mveRichard Deeming28-Aug-18 7:16 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng28-Aug-18 7:46
JimFeng28-Aug-18 7:46 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming28-Aug-18 7:56
mveRichard Deeming28-Aug-18 7:56 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng28-Aug-18 7:57
JimFeng28-Aug-18 7:57 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming28-Aug-18 8:12
mveRichard Deeming28-Aug-18 8:12 
GeneralRe: Access HttpContext in ASP.NET Core Pin
JimFeng29-Aug-18 1:41
JimFeng29-Aug-18 1:41 

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.