Making A Knowledge Center

Step One : Which Language

I chose to program in C# as that is what the company I work for programs in and this would give me a better understanding of how everything comes together.
I also wanted to learn a object based language so a transition would easier to another language.

update: As I got more into it I realized that i would also need to learn JavaScript as the functionality of C# is mostly server side and if statements can be messy and slower.

Step Two: What does it do

I thought about what this web app would actually be. It started of as an internal knowledge base but then turned into more of a client and business site. Meaning that the business would put in the information and then choose whether to share it with the public or only use it for internal.

Step Three: the design

We don’t want to reinvent the wheel here so we are going to be using a bootstrap template. We are using this to be able to optimize the web app to be view-able and function-able on all devices. I have chosen the an admin to use as my template

Step Four: Getting Started


Step Five: Bootstrapping it

Step Six: MVC

Step Seven: Models and Entity Framework

Step Eight: Calling the DB (Lambda or Linq)

Step Nine: Sessions and Cookies

I want the web app to load certain things when the website opens such bg colours, logos, drop down boxes for search and create… etc

Update 2017–02–27: Seeing a problem when grabbing the URL in the helper. Going to pull from the Session instead.

Update 2017–02–27: I have found a problem with doing this for the drop-down boxes for the create page. If someone adds a new Area or Version on the fly it doesn't update until after the Session is restarted. This is a big problem and will need to replaced by an on-load function or on a the submit to db.
Will look into pulling it directly from the database each-time (depending on how slow this will be, we obviously don’t want to call the DB too much)

Step Ten: Helpers

I have been looking around for the best way to convert cookie info to my site and it looks like Helpers are the way forward. They use the IPrincipal function to get the ClaimsIdentity from the Indetity model.

Example:
 public static string GetUserID(this IPrincipal usr)
 {
 var CurrentUserID = ((ClaimsIdentity)usr.Identity).FindFirst(“Id”);
 if (CurrentUserID != null)
 return CurrentUserID.Value;
 else
 {
 return “No ID”;
 }
 }

This will get you the UserID of the person logged in using the indentity of userIdentity.AddClaim(new Claim(“Id”, this.Id));

Update 2017–02–28: This is also super helpful for the ClientInfo I am having problems with. Now I just need to find a way to grab the ClientID before a login using possibly a Session Start to look at the subdomain.

Step Eleven: Dependencies and Separating Projects

Step Twelve: JavaScript: The Best Thing Ever

Form authentication: forcing logins

Wep apis: using JavaScript with web API to create subdomains instead of wildcard. When I move the site over I will allow wildcards