diff --git a/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs new file mode 100644 index 0000000..f23268e --- /dev/null +++ b/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs @@ -0,0 +1,8 @@ +using DigitalData.Core.Abstractions.Infrastructure; +using WorkFlow.Domain.Entities; + +namespace WorkFlow.Application.Contracts.Repositories; + +public interface IButtonRepository : ICRUDRepository +{ +} \ No newline at end of file diff --git a/src/WorkFlow.Domain/Entities/Button.cs b/src/WorkFlow.Domain/Entities/Button.cs index be0ec3d..4c9afe0 100644 --- a/src/WorkFlow.Domain/Entities/Button.cs +++ b/src/WorkFlow.Domain/Entities/Button.cs @@ -1,10 +1,11 @@ -using System.ComponentModel.DataAnnotations; +using DigitalData.Core.Abstractions; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities; [Table("TBMWF_PROF_BUTTONS")] -public class Button +public class Button: IUnique { [Key] [Column("GUID", TypeName = "int")] diff --git a/src/WorkFlow.Infrastructure/DependencyInjection.cs b/src/WorkFlow.Infrastructure/DependencyInjection.cs index decc53e..2ecdf2b 100644 --- a/src/WorkFlow.Infrastructure/DependencyInjection.cs +++ b/src/WorkFlow.Infrastructure/DependencyInjection.cs @@ -15,7 +15,6 @@ public static class DependencyInjection services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); - return services; } } \ No newline at end of file diff --git a/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs b/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs new file mode 100644 index 0000000..ed7d993 --- /dev/null +++ b/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs @@ -0,0 +1,14 @@ +using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Infrastructure; +using WorkFlow.Application.Contracts.Repositories; +using WorkFlow.Domain.Entities; + +namespace WorkFlow.Infrastructure.Repositories; + +//TODO: Make the db context type generic so that it can be used by other projects with different db contexts. +public class ButtonRepository : CRUDRepository, IButtonRepository, ICRUDRepository +{ + public ButtonRepository(WFDBContext dbContext) : base(dbContext, dbContext.Buttons) + { + } +} \ No newline at end of file diff --git a/src/WorkFlow.Infrastructure/WFDBContext.cs b/src/WorkFlow.Infrastructure/WFDBContext.cs index 752d74b..dd77243 100644 --- a/src/WorkFlow.Infrastructure/WFDBContext.cs +++ b/src/WorkFlow.Infrastructure/WFDBContext.cs @@ -34,6 +34,8 @@ public class WFDBContext : DbContext, IUserManagerDbContext public DbSet ClientUsers { get; set; } + public DbSet