Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding [CallerMemberName] to 3 new overloads for the DynamoDbPropertyAttribute #240

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/EfficientDynamoDb/Attributes/DynamoDbPropertyAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Runtime.CompilerServices;

// ReSharper disable IntroduceOptionalParameters.Global

namespace EfficientDynamoDb.Attributes
Expand All @@ -11,7 +13,7 @@ public sealed class DynamoDbPropertyAttribute : Attribute

public DynamoDbAttributeType AttributeType { get; }

public DynamoDbPropertyAttribute(string name) : this(name, null, DynamoDbAttributeType.Regular)
public DynamoDbPropertyAttribute([CallerMemberName] string name = default!) : this(name, null, DynamoDbAttributeType.Regular)
{
}

Expand All @@ -23,6 +25,18 @@ public DynamoDbPropertyAttribute(string name, DynamoDbAttributeType attributeTyp
{
}

public DynamoDbPropertyAttribute(Type? ddbConverterType, [CallerMemberName] string name = default!) : this(name, ddbConverterType, DynamoDbAttributeType.Regular)
{
}

public DynamoDbPropertyAttribute(DynamoDbAttributeType attributeType, [CallerMemberName] string name = default!) : this(name, null, attributeType)
{
}

public DynamoDbPropertyAttribute(Type? ddbConverterType, DynamoDbAttributeType attributeType, [CallerMemberName] string name = default!) : this(name, ddbConverterType, attributeType)
{
}

public DynamoDbPropertyAttribute(string name, Type? ddbConverterType, DynamoDbAttributeType attributeType)
{
Name = name;
Expand Down