diff --git a/src/Abstractions/IEntity/IEntity{TSelf,TId}.cs b/src/Abstractions/IEntity/IEntity{TSelf,TId}.cs index 2013c40..fc82a71 100644 --- a/src/Abstractions/IEntity/IEntity{TSelf,TId}.cs +++ b/src/Abstractions/IEntity/IEntity{TSelf,TId}.cs @@ -2,4 +2,5 @@ namespace Dgmjr.EntityFrameworkCore.Abstractions; public interface IEntity : IEntity, IEquatable> where TSelf : IEntity - where TId : IComparable, IEquatable { } + where TId : IComparable, IEquatable +{ } diff --git a/src/Abstractions/IEntity/ITimestampedEntity{TSelf,TId,TUserId}.cs b/src/Abstractions/IEntity/ITimestampedEntity{TSelf,TId,TUserId}.cs index d7c12c6..1b569b6 100644 --- a/src/Abstractions/IEntity/ITimestampedEntity{TSelf,TId,TUserId}.cs +++ b/src/Abstractions/IEntity/ITimestampedEntity{TSelf,TId,TUserId}.cs @@ -2,4 +2,5 @@ namespace Dgmjr.EntityFrameworkCore.Abstractions; public interface ITimestampedEntity : ITimestampedEntity where TSelf : ITimestampedEntity - where TId : IComparable, IEquatable { } + where TId : IComparable, IEquatable +{ } diff --git a/src/Migrations/CreateFunctionOperation.cs b/src/Migrations/CreateFunctionOperation.cs index 35de21f..47db005 100644 --- a/src/Migrations/CreateFunctionOperation.cs +++ b/src/Migrations/CreateFunctionOperation.cs @@ -5,28 +5,29 @@ namespace Dgmjr.EntityFrameworkCore.Migrations; public class CreateFunctionOperation(string schema, string name, string arguments, string body) : SqlOperation { - public string Schema { get; set; } = schema; - public string Name { get; set; } = name; - public string Arguments { get; set; } = arguments; - public string Body { get; set; } = body; - - public override string Sql => - Format(CreateOrAlterFunctionPattern, Schema, Name, Arguments, Body); - - public CreateFunctionOperation( - MethodInfo mi, - string body, - string schema = DboSchema.ShortName, - string? name = default, - string? arguments = default - ) - : this( - schema, - name ?? mi.Name, - arguments - ?? mi.GetParameters() - .Select(p => $"@{p.Name} {ClrTypeToSqlTypeMap[p.ParameterType]}") - .Join(", "), - body - ) { } + public string Schema { get; set; } = schema; +public string Name { get; set; } = name; +public string Arguments { get; set; } = arguments; +public string Body { get; set; } = body; + +public override string Sql => + Format(CreateOrAlterFunctionPattern, Schema, Name, Arguments, Body); + +public CreateFunctionOperation( + MethodInfo mi, + string body, + string schema = DboSchema.ShortName, + string? name = default, + string? arguments = default +) + : this( + schema, + name ?? mi.Name, + arguments + ?? mi.GetParameters() + .Select(p => $"@{p.Name} {ClrTypeToSqlTypeMap[p.ParameterType]}") + .Join(", "), + body + ) +{ } } diff --git a/src/Migrations/DropFunctionOperation.cs b/src/Migrations/DropFunctionOperation.cs index 5e76bbf..4fac303 100644 --- a/src/Migrations/DropFunctionOperation.cs +++ b/src/Migrations/DropFunctionOperation.cs @@ -4,9 +4,9 @@ namespace Dgmjr.EntityFrameworkCore.Migrations; public class DropFunctionOperation(string schema, string name) : SqlOperation { - public string Schema { get; set; } = schema; - public string Name { get; set; } = name; - public override bool IsDestructiveChange => true; - - public override string Sql => Format(DropFunctionIfExistsPattern, Schema, Name); + public string Schema { get; set; } = schema; +public string Name { get; set; } = name; +public override bool IsDestructiveChange => true; + +public override string Sql => Format(DropFunctionIfExistsPattern, Schema, Name); }