Get me outta here!

Thursday, February 6, 2025

Process for updating Edmx on Entity Framework

  • Update in Dto
  • Update in Main Table
  • Add Scalar Property in Edmx Table
  • Open Edmx in xml format and add the property
  • Then go to table mappings and map the added field

Monday, September 9, 2024

Auth-Session Vs JWT

 


Monday, August 19, 2024

Class/Record/Struct

 

FeatureClassRecordStruct
TypeReference TypeReference Type (since C# 10, can be record struct)Value Type
Memory AllocationTypically allocated on the heap.Typically allocated on the heap.Typically allocated on the stack (or heap if used as part of a class or array)
Default ConstructorCan have a parameterless constructor, and can be explicitly defined.Implicit parameterless constructor is not allowed; parameters are required.Parameterless constructor is provided by default and initializes all fields to default values.
InheritanceSupports inheritance (can inherit from other classes and be inherited).Supports inheritance (can inherit from other records but not from classes).Does not support inheritance (cannot inherit from or be inherited by other types).
EqualityUses reference equality by default, can override Equals and GetHashCode for value-based equality.Uses value-based equality by default (based on all properties). Automatically implements Equals, GetHashCode, and ToString.Uses value-based equality by default (based on all fields). Automatically implements Equals, GetHashCode, and ToString.
MutabilityMutable by default; properties can be changed after object creation.Immutable by default; properties are readonly and set via constructor.Immutable by default (properties are typically readonly and initialized in the constructor).
DeconstructionNot supported by default.Supports deconstruction with tuple-like syntax.Supports deconstruction with tuple-like syntax.
ConstructorCan have multiple constructors with various parameters.Primary constructor is defined with positional parameters; can also have additional constructors.Constructor must initialize all fields; no parameterless constructor allowed unless provided by the compiler.
Default ValuesFields initialized to default values if not explicitly set.Properties are initialized via the constructor.Fields are initialized to default values (e.g., 0, null).
Use CasesUsed for complex objects with behavior and mutable state.Ideal for immutable data models, DTOs, and scenarios where value-based equality is important.Ideal for lightweight, immutable data structures where copying and stack allocation are beneficial.

Friday, May 17, 2024

Angular Basics

Intro

•    package.json

•     (list of dependencies)

•    package-lock.json

•     (details list of that dependencies)

•    angular.json

•     (map everything here: assets, scripts etc)

•    tsconfig.json

•     (typescript configuration file)

•    polyfills.ts

•     (compatibility file)

 

Components

•    Modules must be declared in the imports

•    Components must be declared in the declarations

•    Standalone components are not dependent in any modules and it must be declared in imports

•    and Pipes are doing the transformation over text


Bindings - Two Way, Property, Event


Routing

•    Basic Routing

•      Routes – for mapping path & component

•      routerLink – navigate to different routes

•      router-outlet– for displaying matched route

•    Child routing

•     Activated Route (const routeId = route.snapshot.paramMap.get(‘id’);)

•    Module Routing

•     const routes : Routes

•    Lazy Loading

•     Load when required (loadChildren then import)


Directives

•    Add additional behavior to elements

•    Components works as a directive

•    Attribute Directive

ngClass (Binding Classes)

ngStyle (Binding Styles, Only accept objects s = {})

ngModel (Two Way Binding)

•    Structural Directive

*ngIf

*ngFor

*ngSwitch


Services

•    Defined with @Injectable

•    All are in observable format and without subscribe it won’t work (Rxjs feature)


FormType

•    TDF – handle in html file

•     ngForm

•    Reactive – handle in ts file

•     FormGroup


Guard

•    used to control access in particular route

•    canActivate

•    canActivateChild

•    canDeactivate

•    canLoad


Interceptor

•    Used for token login

•    Declares in app.module [Providers]


Rxjs

•    Observable and Operators

•    Promise (then, then, finally)