feat(Button): create repositry

This commit is contained in:
Developer 02 2025-07-29 19:55:20 +02:00
parent 8655f78c8c
commit 87857862e4
5 changed files with 27 additions and 3 deletions

View File

@ -0,0 +1,8 @@
using DigitalData.Core.Abstractions.Infrastructure;
using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts.Repositories;
public interface IButtonRepository : ICRUDRepository<Button, int>
{
}

View File

@ -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<int>
{
[Key]
[Column("GUID", TypeName = "int")]

View File

@ -15,7 +15,6 @@ public static class DependencyInjection
services.TryAddScoped<IProfileRepository, ProfileRepository>();
services.TryAddScoped<IProfileObjRepository, ProfileObjRepository>();
services.TryAddScoped<IStateRepository, StateRepository>();
return services;
}
}

View File

@ -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<Button, int, WFDBContext>, IButtonRepository, ICRUDRepository<Button, int>
{
public ButtonRepository(WFDBContext dbContext) : base(dbContext, dbContext.Buttons)
{
}
}

View File

@ -34,6 +34,8 @@ public class WFDBContext : DbContext, IUserManagerDbContext
public DbSet<ClientUser> ClientUsers { get; set; }
public DbSet<Button> Buttons { get; set; }
public WFDBContext(DbContextOptions options) : base(options)
{
}