Posts

Integrate ChatGPT OpenAI API in .NET Core Console Application from scratch.

Image
  In this Article I am going to demonstrate the integration of ChatGPT OpenAI API in .NET Core Console Application from scratch step by step.      Using ChatGPT API we can integrate the AI in our application just we need to call the API with the help of generating the secret key in ChatGPT developer page following is the steps to generate the secret key with screenshots.  You need to login with the ChatGPT credentials before generating the Secret Key.  On right corner of the page, click on personal icon and then click on View Api Key link On API Keys page click on +Create new secret key button  Then type your desired API key name and then click on   Create secret key button Your API key will be generated then click on copy button to copy the key and save it safely. Congratulation!!! your API key is created for use in console application.        Now we have the secret key with us then we can now move to ChatGPT page and get the code for the integration with console application from

Create the react element with JSX and Implement Click event in React App

Image
  In previous article we discussed how to create react app from scratch and we also discussed about the project structure of the react app.In this article i will be discussing about the how to create the react element with JSX and how to implement Click event in React App.       Create the react element with JSX:  In app.js file i will remove the default code returned in the App() method and add the following code. App.Js   import logo from './logo.svg'; import './App.css'; function App() { return ( <span>Hello world!</span> ) } export default App;  then run the below command: npm start  You will get the below output in browser.  now i try to add another span then the below error will be shown in VS Code:  this error is because in react you should have one parent element and under that you can have unlimited child elements. So you need to add the parent div element under that you can add both the span like below example

Getting started with react JS step by step from scratch

Image
 In this article we will be discussing how to create react app from scratch. We will also discuss about the project structure of react app. React JS is an library but most people says its an framework. Its actually an library by using it we can develop robust applications.     For react app we need to have install Node Js on development machine. To download Node JS you can visit below link and install it on your machine. https://nodejs.org/en/download/     I recommend you to always download LTS (Long term support) executable versions only.   Now we have downloaded and installed the node JS, its time to download and install the code editor to manage your code efficiently. I would recommend you that you can go with the Visual studio code. following is the link to download the visual studio code.   https://code.visualstudio.com/   Now we have downloaded and installed visual studio code as well as Node JS. Lets launch the visual studio code, go to menu bar and click on Terminal option >

Custom Validation and Class Level validation using Data Annotation in MVC .Net core application

Image
 In Previous article i have demonstrated about " Validations using entity framework data annotation in .Net core MVC " where i have implemented ready made validation types in MVC application. In this article i will be demonstrating about custom validation and class level validation using Data Annotation in MVC .Net core application. The custom validation will be very useful when we need to solve real time scenario where the ready made validation will not work. I also going to show about the class level validation which is also a type of custom kind validation available in data annotation using entity framework. Lets start the implementation, I going to use the same application which i have used in previous article. First we need to add few columns in existing employee table for validation demonstration as below. DateOfBirth DateOfJoin DateOfExit  After adding above fields my model class will look like below using ModelsExample.Attributes; using System; using System.Co