Course (Bangla) on Role-Based-Access-Control using Web API and AngularJS (TypeScript)

We are designing new course. This time we are targeting the mid and upper mid level Dot Net Developers so that they can boost their career to the next level. Below is the proposed topics. Please let us know if you want anything extra by commenting here or Facebook link.

Server

  • Recap Repository Pattern
  • Create the engine using Inheritance, Generics, Reflection and Expression
  • Design the solution architecture
  • Implement the design
  • Web API – Identity, Filters
  • Final Recap

 

Client

  • Recap Angular and TypeScript
  • Design the solution architecture
  • Implement the design
  • AngularJS – Directives, Events (route change, interceptor etc.)
  • Final Recap

 

Miscellaneous

  • Server side logging
  • Gulp automation
  • Deployment to Godaddy and Github
  • Unit Testing

 

Assignment

  • Create a whole new project covering the above topics (in github)

 

FAQ:

  1. Course fee : Not decided yet
  2. Approximate day to launch : End of April, 2017 (In Sha Allah)
  3. Prerequisite : Must have work experience on – C#, Entity Framework and Angular
Advertisements

JavaScript Debugging in Visual Studio 2017

We can now debug JavaScript files from the visual studio ide, and don’t need to debug from browser’s developer tools.

To enable the debugging, go to Tools–>Options–>Debugging then Check the below checkbox.

0

In your JavaScript file, set a debugging breakpoint as you do in C# application development.

Now if you fire-up the application and execute the according code, your breakpoint should be looks like below.

1

We can even do conditional debugging as we tend to do in normal .NET Development.

2

3

Thanks for reading. Hope this helps.

 

Xamarin.Forms Previewer

After the last update of Xamarin, I could finally see the preview of the XAML page of Xamarin.Forms project. I want to share the process with you. Just follow the below steps.

Create Project

1

2

Then check if you have JDK 1.8+ installed or not. If not please install X64 version.

3

Update your Xamarin Forms whole solution.

01-1

Open the Forms Preview window.

4

You should see an error. In that case please rebuild the solution and try to open different page until you see the actual preview.

This slideshow requires JavaScript.

 

How to change the Database Connection of LINQ to SQL Class

Introduction

Its very common that couple of developers are working on a single project. Me and one of my friend are also working on a .NET project. We are using LINQ to SQL class to query on the database. This is a desktop Windows Form project and we are maintaining our code as dumbest way possible. That is, when i update on any part, i just mail him the file and he replaces the file. So far so good.

Problem statement

But when I sent him my project, he couldn’t run the database queries. Because the connection string embed on the DataContext.dbml class was not changed. He couldn’t find a good way to change the connection string value. So I was searching for a better solution, and at last I found it today.

Solution

1. Double click on the DBML file of your project.

 

2. Now right click on the work area of the DBML file (Start sign in the image)
3. Expand the connection property and check the Data Source value. in my case, it is ‘Magicbox’ since it is my machine’s server name
4. If your server is not in mentioned, it means, you need to create another connection between your server and the DBML file. So, click on the ‘New; displayed in the image
5. Put your server name or click on the combo box (the arrow sign)
6. If your server name is not displayed after clicking on the combo, please write the name by your own ( my server’s name is not showing also)
7. Now click the database name combo box at the bottom side of the window. You will see the database names attached with your server
8. Select the database and click ‘Test Connection’ button. you will get a success message is connection succeed. Now close the success message and press OK button at the bottom of the page
9. Now if you click the connection combo again, you should see the just added database connection as the item of the combo
Conclusion:
We now just change the database connection value from the properties of the DBML file and working fine.

HTML Document Object Model

What is it?

The HTML DOM defines a standard way for accessing and manipulating HTML documents. The DOM presents an HTML document as a tree-structure.

In the DOM, everything in an HTML document is a node.

The DOM says:

  • The entire document is a document node
  • Every HTML element is an element node
  • The text in the HTML elements are text nodes
  • Every HTML attribute is an attribute node
  • Comments are comment nodes

Example Node tree:

<html>
<head>
<title>DOM Tutorial</title>
</head>
<body>
<h1>DOM Lesson one</h1>
<p>Hello world!</p>
</body>
</html>

From the HTML above:

  • The <html> node has no parent node; it is the root node
  • The parent node of the <head> and <body> nodes is the <html> node
  • The parent node of the “Hello world!” text node is the <p> node

and:

  • The <html> node has two child nodes; <head> and <body>
  • The <head> node has one child node; the <title> node
  • The <title> node also has one child node; the text node “DOM Tutorial”
  • The <h1> and <p> nodes are siblings, and both child nodes of <body>

It has some properties and methods as well.

Some DOM properties:

  • x.innerHTML – the text value of x
  • x.nodeName – the name of x
  • x.nodeValue – the value of x
  • x.parentNode – the parent node of x
  • x.childNodes – the child nodes of x
  • x.attributes – the attributes nodes of x

Note: In the list above, x is a node object (HTML element).

Some DOM methods:

  • x.getElementById(id) – get the element with a specified id
  • x.getElementsByTagName(name) – get all elements with a specified tag name
  • x.appendChild(node) – insert a child node to x
  • x.removeChild(node) – remove a child node from x

Note: In the list above, x is a node object (HTML element).

Example:

<html>
<body>

<p id=”intro”>Hello World!</p>

<script type=”text/javascript”>
txt=document.getElementById(“intro”).innerHTML;
document.write(“<p>The text from the intro paragraph: ” + txt + “</p>”);
</script>

</body>
</html>

DOM Methods details:

getElementById(parameter): gets the element which has the id equals to the parameter

getElementsByTagName(parameter): gets the element which is the html tag equals to the parameter

Working with DOM code snippets:

document.body.bgColor=”lavender”; //changes the document’s background color

document.getElementById(“p1″).innerHTML=”New text!”; // replaces the text of all p1 id element with “New text”

<input type=”button” onmouseover=”document.body.bgColor=’green'” onclick=”document.body.bgColor=’lavender’;” value=”Change background color” />

.style : this property indicates you can also work with the element’s style values

Events:

Examples of events:

  • A mouse click
  • A web page or an image loading
  • Mousing over a hot spot on the web page
  • Selecting an input box in an HTML form
  • Submitting an HTML form
  • A keystroke

Example: <input type=”text” id=”email” onchange=”checkEmail()” />

For more: visit W3Schools