Showing Tag: "class" (Show all posts)

Paste JSON as Classes

Posted by jineesh uvantavida on Thursday, November 10, 2022, In : Tips & Ideas. 
Paste JSON as Classes

When working with APIs we often send a request and receive JSON data. Using C#, we need to transform the data into an object tree. That’s where what I’m going to show you is a game-changer.

First, let’s assume we receive the following JSON data from an API:
{
  "squadName": "Super hero squad",
  "homeTown": "Metro City",
  "formed": 2016,
  "secretBase": "Super tower",
  "active": true,
  "members": [
    {
      "name": "Molecule Man",
      "age": 29,
      "secretIdentity": ...

Continue reading ...
 

Difference between Abstract Class and Interface in C#

Posted by jineesh uvantavida on Monday, June 7, 2021,
Abstract Class
  • Its a way to achieve abstraction in c#.
  • Not instantiated directly
  • must contain at least one abstract method.
  • used to define base class.
  • contains both declaration and definition.
  • contains constructor.
  • it can contain static members
  • contains different types of access modifiers like public, private, protected.
  • performance of abstract class is fast.
  • used to implement core identity of class
  • a class can only use one abstract class.
  • if many implementation are same kind and common behavior, then it...

Continue reading ...
 
 

Translate This Page

 


Make a free website with Yola