I am creating an API for a module, and after I created several methods inside my classes, I asked myself this question.
Right now, and as an example, I am doing this:
public Company GetMonitoredCompany( String companyName ) { ... } public List<Company> GetMonitoredCompanies( ) { ... }
But I understand that several times when I use other APIs / Services, sometimes they can have a Collection in the name:
public List<Company> GetMonitoredCompanyCollection( ) { ... }
Is there a rule for this? template? or should it be good anyway?
Use the shortest, simplest name that clearly shows the purpose of the method. And be consistent in your project.
, , :
GetMonitoredCompanies
.
( ICollection IEnumerable , , .)
. ... (GetMonitoredCompanies)
(, ..), (GetMonitoredCompanies), . . , , .
, , , . List Get ,
ListMonitoredCompanies
intellisense, , , , .
- , . , . , ? , ( , .., ).
, () .
, . ( , , ), FunctionThatLoadsTheTotalFromFileNumberCount (Number), (Count), (Function) , .
.NET Framework. . Directory.GetFiles Type.GetMembers . , .