feat(Button): create repositry
This commit is contained in:
parent
8655f78c8c
commit
87857862e4
@ -0,0 +1,8 @@
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using WorkFlow.Domain.Entities;
|
||||
|
||||
namespace WorkFlow.Application.Contracts.Repositories;
|
||||
|
||||
public interface IButtonRepository : ICRUDRepository<Button, int>
|
||||
{
|
||||
}
|
||||
@ -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")]
|
||||
|
||||
@ -15,7 +15,6 @@ public static class DependencyInjection
|
||||
services.TryAddScoped<IProfileRepository, ProfileRepository>();
|
||||
services.TryAddScoped<IProfileObjRepository, ProfileObjRepository>();
|
||||
services.TryAddScoped<IStateRepository, StateRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
14
src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs
Normal file
14
src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user