Posts

Showing posts from December, 2025

Implement Dot net watcher

Dot Net Watcher. 1.  Set Up the .NET Core API If you don’t already have an API project, create one: dotnet new webapi -n FileWatcherApi  cd  FileWatcherApi 2.  Add the FileSystemWatcher Implementation Open the project in your favorite editor (e.g., Visual Studio, VS Code). Create a new service class to manage file watching. For example: Add a new folder named  Services . Create a file named  FileWatcherService.cs . Implement the  FileWatcherService : using System; using System.IO; namespace FileWatcherApi.Services {     public class FileWatcherService     {         private readonly FileSystemWatcher _fileWatcher;         public FileWatcherService(string pathToWatch)         {             if (!Directory.Exists(pathToWatch))             {                 throw new DirectoryNotF...

what are props and how use them in react js

  Props (properties) are how you pass data from a parent component to a child component . They are read-only — the child component can use them but should not change them. Passing props (Parent ➜ Child) Parent component function App ( ) { return ( < Greeting name = "Achla" message = "Welcome to React!" /> ); } Child component (receiving props) function Greeting ( props ) { return ( < h2 >Hello {props.name} — {props.message} </ h2 > ); } Passing numbers, arrays, objects & functions function App ( ) { const user = { name : "Achla" , age : 25 }; return ( < Profile user = {user} hobbies = {[ " reading ", " traveling "]} onLogin = {() => alert("Logged in!")} /> ); } Child: function Profile ( { user, hobbies, onLogin } ) { return ( <> < p >{user.name} — {user.age} </ p > < p >Hobbies: {hobb...