kankan-dev / dotnetCowin

Covid-19 Vaccine Near You
0 stars 0 forks source link

Made Spaghetti in One controller #1

Open Katik1408 opened 3 years ago

Katik1408 commented 3 years ago

Implement Single Responsibility Principle and Separation of Concerns.

kankan-dev commented 3 years ago

I'll explain. The available slots this api retrieves is from "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict?district_id=140&date=15-05-2021" It uses district Id, which normal people wont know. To retrieve District Id, we must also get state id. So I created a function which retrieves state id from corresponding state name and that state id is passed onto district url to get the district id from the corresponding district name which is passed on [FromBody] And now matching those credentials the main retrieving api collects required data and posts it

kankan-dev commented 3 years ago

Also I have no Idea what is Single Responsibility Principle! @Katik1408

kankan-dev commented 3 years ago

Like how to make it SRP?

Katik1408 commented 3 years ago

Dont tell me you dont know.... Just google and try to implement.