Refactored repository pattern for Add and Update methods so that they return their respective entity objects

This commit is contained in:
Shaun Walker
2019-08-05 09:31:04 -04:00
parent b9c007998e
commit 4fda7b17d0
43 changed files with 353 additions and 137 deletions

View File

@ -96,6 +96,21 @@ CREATE TABLE [dbo].[User](
)
GO
CREATE TABLE [dbo].[SiteUser](
[SiteUserId] [int] IDENTITY(1,1) NOT NULL,
[SiteId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[IsAuthorized] [bit] NOT NULL,
[CreatedBy] [nvarchar](256) NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [nvarchar](256) NOT NULL,
[ModifiedOn] [datetime] NOT NULL,
CONSTRAINT [PK_SiteUser] PRIMARY KEY CLUSTERED
(
[SiteUserId] ASC
)
)
GO
/*
Create foreign key relationships
@ -125,6 +140,15 @@ REFERENCES [dbo].[Page] ([PageId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[SiteUser] WITH CHECK ADD CONSTRAINT [FK_SiteUser_Site] FOREIGN KEY([SiteId])
REFERENCES [dbo].[Site] ([SiteId])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[SiteUser] WITH CHECK ADD CONSTRAINT [FK_SiteUser_User] FOREIGN KEY([UserId])
REFERENCES [dbo].[User] ([UserId])
GO
/*
Create seed data