A set of coding guidelines for all C# versions up to 7.3, design principles and layout rules for improving the overall quality of your code development.
dennisdoomen on master
Remove ICollection<T> as an all… (compare)
Hey Guys, with respect to AV1515. Would the literal used here be considered a magic number when the constructor is define as:
/// <param name="characterCount">The amount of characters that a segment should have.</param>
public Segment(int characterCount) and the usage is as such public class
ModelSegment : Segment { public Model() : base(4) {} }
Would the 4 above be considered magic or is being aware of the definition of the parameter be enough?
SegmentCharacterCount
, but you are unaware of the base constructor it is used in. Wouldn't it mean that it's not possible review the code for correctness because you wouldn't know whether the name SegmentCharacterCount
is correct? On the flip side if you are aware of what the base constructor is doing then wouldn't you be aware of what the literal represents without it being in a constant?
Hi all ,C:\Program Files (x86)\MSBuild\14.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(277,5): error MSB4184: The expression "[System.IO.Path]::GetFullPath(C:/Jenkins/workspace/DataScience/datascience-buildrequest\C:/Jenkins/workspace/DataScience/datascience-buildrequest\Assemblies\)" cannot be evaluated. The given path's format is not supported.
Save
and CanSave
public async Task<IEnumerable<User>> GetUsersAsync(
Guid customerId,
CancellationToken token = default)
{
EnsureArg.IsNotEmpty(customerId, nameof(customerId));
if (!await CompanyExistsAsync(customerId))
{
_logger.LogError(ExceptionMessages.UnknownCustomerException, customerId);
throw new UnknownCustomerException(ExceptionMessages.UnknownCustomerException, customerId);
}
IEnumerable<Data.User> dbUsers = _userRepository.GetUsersForCustomer(customerId);
var users = _mapper.Map<IEnumerable<User>>(dbUsers);
return users;
}