-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
221 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
WebApplication1/Migrations/20231107040916_ExtendedBaseAudit.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
WebApplication1/Migrations/20231107040916_ExtendedBaseAudit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace WebApplication1.Migrations | ||
{ | ||
public partial class ExtendedBaseAudit : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<string>( | ||
name: "UserId", | ||
table: "BlogAudits", | ||
type: "nvarchar(max)", | ||
nullable: false, | ||
defaultValue: ""); | ||
|
||
migrationBuilder.AddColumn<string>( | ||
name: "UserName", | ||
table: "BlogAudits", | ||
type: "nvarchar(max)", | ||
nullable: false, | ||
defaultValue: ""); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropColumn( | ||
name: "UserId", | ||
table: "BlogAudits"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "UserName", | ||
table: "BlogAudits"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
using Infoware.EntityFrameworkCore.AuditEntity; | ||
using Infoware.SRI.DocumentosElectronicos.Context.Models; | ||
|
||
namespace Test.Models | ||
{ | ||
public class BlogAudit : BaseAudit<Blog, long> | ||
public class BlogAudit : ExtendedBaseAudit<Blog, long> | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Infoware.EntityFrameworkCore.AuditEntity; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Infoware.SRI.DocumentosElectronicos.Context.Models | ||
{ | ||
public class ExtendedBaseAudit<TEntity, TUniqueId> : BaseAudit<TEntity, TUniqueId>, IExtendedBaseAudit where TEntity : IAuditable | ||
{ | ||
[Required] | ||
public string UserId { get; set; } = null!; | ||
|
||
[Required] | ||
public string UserName { get; set; } = null!; | ||
} | ||
|
||
public interface IExtendedBaseAudit : IBaseAudit | ||
{ | ||
public string UserId { get; set; } | ||
|
||
public string UserName { get; set; } | ||
} | ||
} |