masto.ai is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general Mastodon server for all languages.

Administered by:

Server stats:

2.2K
active users

Just saw something really strange that I have never seen before as a dev:
Using a `record` for a service that is registered in DI.

Are there any devs here that do this and can tell me why? Any huge benefits I'm not seeing here?

Dr_Cox1911

I thought about this since I posted it and think that the cons outweigh the pros for using records for services.

Some cons I see:
1. Problems with libs: some libs require you to inherit from a class
2. Exposed dependencies: injecting something inside your Records will store it in a public prop
3. unnecessary IL code: for my services I don't really care for value comparison

The (only?) pro so far:
1. less boilerplate code