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

ASP.NET

 
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 
General[solved] Pin
jkirkerx27-Aug-18 7:59
professionaljkirkerx27-Aug-18 7:59 
It was about updating the country collection, and not inserting.
Guess there are two ways to work with MongoDB, one being through a context using the driver, and the other working with the MongoDB .Net Core driver straight.
This is where I got confused. So I'm using my MongoDBContext in my repositories which are CRUD and just the driver in my services which are REST.
Anyways, this is just a learning exercise for later use. I'll dump it and replace it with a text file written in the same BSON format later down the road.
But at least I got this working for now, well I haven't consumed yet so I'll find out.
// Let See if we can inject the States collection into Countries/States
var filter_US = Builders<WEBSITE_COUNTRIES>.Filter.Eq(s => s.ShortName, country.ShortName.ToUpper());
var update_US = Builders<WEBSITE_COUNTRIES>.Update.Set(s => s.States, states_US);
await websiteCountries.UpdateOneAsync(filter_US, update_US);

And my result, I saw Arizona is wrong, fixed.
{
    "_id" : ObjectId("5b8434defb1e6524f8cc0554"),
    "DisplayId" : "5b8434defb1e6524f8cc0554",
    "LongName" : "United States",
    "ShortName" : "US",
    "States" : [ 
        {
            "_id" : ObjectId("5b8434dffb1e6524f8cc0582"),
            "Name" : "Alabama",
            "Abbr" : "AL"
        }, 
        {
            "_id" : ObjectId("5b8434dffb1e6524f8cc0583"),
            "Name" : "Alaska",
            "Abbr" : "AK"
        }, 
        {
            "_id" : ObjectId("5b8434dffb1e6524f8cc0583"),
            "Name" : "Arizona",
            "Abbr" : "AZ"
        }, 
        {
            "_id" : ObjectId("5b8434dffb1e6524f8cc0585"),
            "Name" : "Arkansas",
            "Abbr" : "AR"
        }, 

On a side not about my Angular V6 .Net Core 2.1 training exercise:
I finally got all my folders and files organized efficiently. Basically modules, components and services in Angular, plus my routing with lazy loading is correct. Figured out how to change navbars and footers using *ngIf. Got my new Auth Guard authentication working in Angular, including the Auth0 token and wrote a REST service in .Net Core to handle it, with cookies and token generation. My ContactUs works with my CRUD Repository, just have to write the email part, and figure out if I should do it in .Net Core, Angular or write something in NodeJS for it. Perhaps a .Net console app. So now I can move forward with more head scratchers and frustration. What I have learned so far is that Angular V6 is one thing and .Net Core is a whole different beast, but sort of the same. It's really hard to integrate or write and learn the two together. I can see learning Angular V6 first, and then dropping it into .Net Core and hooking it up being a better path to take. But then you have to architect your.Net Core 2 project in order to pull that off, and can't really rely on a template.

I'm pretty sure I have the terminology correct here. If I'm wrong feel free to correct me so I can get it right.
If it ain't broke don't fix it
Discover my world at jkirkerx.com

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 
GeneralRe: Access HttpContext in ASP.NET Core Pin
Richard Deeming29-Aug-18 2:44
mveRichard Deeming29-Aug-18 2:44 

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.