0
services.AddTransient<JsonFileChampService>();

Does anyone know what the the less than and greater than symbols do after the method name but before the ()?

JsonFileChampService is a .cs file.

In general, what does the '< >' do in C#/.Net/ ASP.net?

Thank you!

Sathish Guru V
  • 1,417
  • 2
  • 15
  • 39
Paulie
  • 11
  • 2
  • 1
    Besides `JsonFileChampService` being a cs file, it is also a class that is used to initialize the transient method via AddTransient method of `Type` `JsonFileChampService`. [Read here for Transient method](https://stackoverflow.com/a/38139500/1390548) – Jawad Jun 29 '20 at 01:08
  • Thanks a lot for the help and the link! – Paulie Jun 29 '20 at 01:15
  • 2
    Search online for `c# generics`. Plenty of documentation to find on it – NotFound Jun 29 '20 at 07:44

1 Answers1

0

In general, what does the '< >' do in C#/.Net/ ASP.net?

'<>' symbol defines a type.

For example you want to initialise a list of integers:

var listInt = new List();

Or a list of an object: var listObj = new List();

So it defines that the list we are initialising has integers or objects. As for your sample attached it defines that you add a service of type JsonFileChampService.

Flori Bruci
  • 436
  • 4
  • 11