-
Notifications
You must be signed in to change notification settings - Fork 176
Closed
Azure/azure-sdk-for-net
#26205Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.
Description
While the following is probably ok, it would be best and follow convention to call into base()'s constructor.
public abstract class TrackedResource<TModel> : TrackedResource
where TModel : class
{
/// <summary>
/// Initializes a new instance of the <see cref="TrackedResource{TModel}"/> class.
/// </summary>
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
/// <param name="location"> The location of the resource. </param>
/// <param name="data"> The model to copy from. </param>
protected TrackedResource(ResourceIdentifier id, LocationData location, TModel data)
{
Id = id;
Location = location;
Model = data;
}
Copied from Repro Steps when changed from Bug to User Story
Copied from Description when changed from Feature to Bug
Be Careful with Virtual Method Calls from the Constructor (and Destructor) of your Classes in C++/C#/Java! - CodeProject.
While the following is probably ok, it would be best and follow convention to call into base()'s constructor.
public abstract class TrackedResource<TModel> : TrackedResource
where TModel : class
{
/// <summary>
/// Initializes a new instance of the <see cref="TrackedResource{TModel}"/> class.
/// </summary>
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
/// <param name="location"> The location of the resource. </param>
/// <param name="data"> The model to copy from. </param>
protected TrackedResource(ResourceIdentifier id, LocationData location, TModel data)
{
Id = id;
Location = location;
Model = data;
}
Metadata
Metadata
Assignees
Labels
MgmtThis issue is related to a management-plane library.This issue is related to a management-plane library.