Skip to content

Commit

Permalink
Jinget no longer uses AutoMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
vahid committed May 9, 2024
1 parent e628868 commit 9c0d149
Show file tree
Hide file tree
Showing 226 changed files with 9,040 additions and 9,300 deletions.
16 changes: 7 additions & 9 deletions 01-Core/Jinget.Core/Attributes/AuthenticationRequired.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
namespace Jinget.Core.Attributes;

namespace Jinget.Core.Attributes
/// <summary>
/// This attribute are useful in scenarios like Service Hub, where prior to calling an API we need to authenticate it
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public class AuthenticationRequiredAttribute(bool required) : Attribute
{
/// <summary>
/// This attribute are useful in scenarios like Service Hub, where prior to calling an API we need to authenticate it
/// </summary>
public class AuthenticationRequiredAttribute(bool required) : Attribute
{
public bool Required { get; set; } = required;
}
public bool Required { get; set; } = required;
}
22 changes: 8 additions & 14 deletions 01-Core/Jinget.Core/Attributes/ClaimAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
using Microsoft.AspNetCore.Authorization;
namespace Jinget.Core.Attributes;

namespace Jinget.Core.Attributes
/// <summary>
/// Used for assigning claims for actions
/// </summary>

public class ClaimAttribute : AuthorizeAttribute
{
/// <summary>
/// Used for assigning claims for actions
/// Gets or sets the claim title.
/// </summary>
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

public class ClaimAttribute : AuthorizeAttribute
{
/// <summary>
/// Gets or sets the claim title.
/// </summary>
public string Title { get; set; }
}
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

public required string Title { get; set; }
}
22 changes: 10 additions & 12 deletions 01-Core/Jinget.Core/Attributes/EntityAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
using System;
namespace Jinget.Core.Attributes;

namespace Jinget.Core.Attributes
/// <summary>
/// Used for assigning custom configurations for entity properties
/// </summary>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
public class EntityAttribute : Attribute
{
/// <summary>
/// Used for assigning custom configurations for entity properties
/// <summary>
/// Gets or sets a value indicating whether the entity is used as an elastic search index or not.
/// </summary>
public class EntityAttribute : Attribute
{
/// <summary>
/// Gets or sets a value indicating whether the entity is used as an elastic search index or not.
/// </summary>
/// <value><c>true</c> if [elastic search enabled]; otherwise, <c>false</c>.</value>
public bool ElasticSearchEnabled { get; set; }
}
/// <value><c>true</c> if [elastic search enabled]; otherwise, <c>false</c>.</value>
public bool ElasticSearchEnabled { get; set; }
}
28 changes: 13 additions & 15 deletions 01-Core/Jinget.Core/Attributes/SummaryAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
using System;
namespace Jinget.Core.Attributes;

namespace Jinget.Core.Attributes
/// <summary>
/// Manage Method Summary Attribute
/// </summary>
/// <remarks>
/// provide method summary for using in access management
/// </remarks>
/// <param name="description"></param>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public class SummaryAttribute(string description) : Attribute
{

/// <summary>
/// Manage Method Summary Attribute
/// Action's description. this value will be shown to the end user
/// </summary>
/// <remarks>
/// provide method summary for using in access management
/// </remarks>
/// <param name="description"></param>
public class SummaryAttribute(string description) : Attribute
{

/// <summary>
/// Action's description. this value will be shown to the end user
/// </summary>
public string Description { get; set; } = description;
}
public string Description { get; set; } = description;
}
9 changes: 3 additions & 6 deletions 01-Core/Jinget.Core/Attributes/SwaggerExcludeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
namespace Jinget.Core.Attributes;

namespace Jinget.Core.Attributes
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
public class SwaggerExcludeAttribute : Attribute { }
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
public class SwaggerExcludeAttribute : Attribute { }
Loading

0 comments on commit 9c0d149

Please sign in to comment.