diff --git a/src/IdentityServer/Duende/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/IdentityServer/Duende/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index d798c6a5b..c8b73d619 100644 --- a/src/IdentityServer/Duende/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/IdentityServer/Duende/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,7 +13,5 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } } diff --git a/src/IdentityServer/Duende/ClassifiedAds.Domain/Specifications/Specification.cs b/src/IdentityServer/Duende/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index c79ca7372..000000000 --- a/src/IdentityServer/Duende/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications -{ - internal sealed class IdentitySpecification : Specification - { - public override Expression> ToExpression() - { - return x => true; - } - } - - public abstract class Specification - { - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - { - return specification; - } - - if (specification == All) - { - return this; - } - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - { - return All; - } - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } - } - - internal sealed class AndSpecification : Specification - { - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } - } - - internal sealed class OrSpecification : Specification - { - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } - } - - internal sealed class NotSpecification : Specification - { - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } - } -} diff --git a/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index d798c6a5b..c8b73d619 100644 --- a/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,7 +13,5 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } } diff --git a/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Specifications/Specification.cs b/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index c79ca7372..000000000 --- a/src/IdentityServer/IdentityServer4/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications -{ - internal sealed class IdentitySpecification : Specification - { - public override Expression> ToExpression() - { - return x => true; - } - } - - public abstract class Specification - { - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - { - return specification; - } - - if (specification == All) - { - return this; - } - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - { - return All; - } - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } - } - - internal sealed class AndSpecification : Specification - { - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } - } - - internal sealed class OrSpecification : Specification - { - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } - } - - internal sealed class NotSpecification : Specification - { - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } - } -} diff --git a/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index 63c6cfc73..d2c0de30c 100644 --- a/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,6 +13,4 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } diff --git a/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Specifications/Specification.cs b/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index aa9b1fefc..000000000 --- a/src/IdentityServer/OpenIddict/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications; - -internal sealed class IdentitySpecification : Specification -{ - public override Expression> ToExpression() - { - return x => true; - } -} - -public abstract class Specification -{ - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - { - return specification; - } - - if (specification == All) - { - return this; - } - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - { - return All; - } - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } -} - -internal sealed class AndSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } -} - -internal sealed class OrSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } -} - -internal sealed class NotSpecification : Specification -{ - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } -} diff --git a/src/Microservices/Common/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/Microservices/Common/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index 63c6cfc73..d2c0de30c 100644 --- a/src/Microservices/Common/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/Microservices/Common/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,6 +13,4 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } diff --git a/src/Microservices/Common/ClassifiedAds.Domain/Specifications/Specification.cs b/src/Microservices/Common/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index ef5d936e2..000000000 --- a/src/Microservices/Common/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications; - -internal sealed class IdentitySpecification : Specification -{ - public override Expression> ToExpression() - { - return x => true; - } -} - -public abstract class Specification -{ - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - return specification; - if (specification == All) - return this; - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - return All; - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } -} - - -internal sealed class AndSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } -} - - -internal sealed class OrSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } -} - - -internal sealed class NotSpecification : Specification -{ - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } -} diff --git a/src/ModularMonolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/ModularMonolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index 63c6cfc73..d2c0de30c 100644 --- a/src/ModularMonolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/ModularMonolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,6 +13,4 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } diff --git a/src/ModularMonolith/ClassifiedAds.Domain/Specifications/Specification.cs b/src/ModularMonolith/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index ef5d936e2..000000000 --- a/src/ModularMonolith/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications; - -internal sealed class IdentitySpecification : Specification -{ - public override Expression> ToExpression() - { - return x => true; - } -} - -public abstract class Specification -{ - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - return specification; - if (specification == All) - return this; - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - return All; - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } -} - - -internal sealed class AndSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } -} - - -internal sealed class OrSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } -} - - -internal sealed class NotSpecification : Specification -{ - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } -} diff --git a/src/Monolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs b/src/Monolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs index 63c6cfc73..d2c0de30c 100644 --- a/src/Monolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs +++ b/src/Monolith/ClassifiedAds.Domain/Infrastructure/MessageBrokers/MetaData.cs @@ -13,6 +13,4 @@ public class MetaData public DateTimeOffset? CreationDateTime { get; set; } public DateTimeOffset? EnqueuedDateTime { get; set; } - - public string AccessToken { get; set; } } diff --git a/src/Monolith/ClassifiedAds.Domain/Specifications/Specification.cs b/src/Monolith/ClassifiedAds.Domain/Specifications/Specification.cs deleted file mode 100644 index aa9b1fefc..000000000 --- a/src/Monolith/ClassifiedAds.Domain/Specifications/Specification.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; - -namespace ClassifiedAds.Domain.Specifications; - -internal sealed class IdentitySpecification : Specification -{ - public override Expression> ToExpression() - { - return x => true; - } -} - -public abstract class Specification -{ - public static readonly Specification All = new IdentitySpecification(); - - public bool IsSatisfiedBy(T entity) - { - Func predicate = ToExpression().Compile(); - return predicate(entity); - } - - public abstract Expression> ToExpression(); - - public Specification And(Specification specification) - { - if (this == All) - { - return specification; - } - - if (specification == All) - { - return this; - } - - return new AndSpecification(this, specification); - } - - public Specification Or(Specification specification) - { - if (this == All || specification == All) - { - return All; - } - - return new OrSpecification(this, specification); - } - - public Specification Not() - { - return new NotSpecification(this); - } -} - -internal sealed class AndSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public AndSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression andExpression = Expression.AndAlso(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(andExpression, leftExpression.Parameters.Single()); - } -} - -internal sealed class OrSpecification : Specification -{ - private readonly Specification _left; - private readonly Specification _right; - - public OrSpecification(Specification left, Specification right) - { - _left = left; - _right = right; - } - - public override Expression> ToExpression() - { - Expression> leftExpression = _left.ToExpression(); - Expression> rightExpression = _right.ToExpression(); - - BinaryExpression orExpression = Expression.OrElse(leftExpression.Body, rightExpression.Body); - - return Expression.Lambda>(orExpression, leftExpression.Parameters.Single()); - } -} - -internal sealed class NotSpecification : Specification -{ - private readonly Specification _specification; - - public NotSpecification(Specification specification) - { - _specification = specification; - } - - public override Expression> ToExpression() - { - Expression> expression = _specification.ToExpression(); - UnaryExpression notExpression = Expression.Not(expression.Body); - - return Expression.Lambda>(notExpression, expression.Parameters.Single()); - } -}