-
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.
Merge pull request #71 from Artsdatabanken/feature/netandnugets
Feature/netandnugets
- Loading branch information
Showing
30 changed files
with
1,858 additions
and
1,928 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
28 changes: 11 additions & 17 deletions
28
Nbic.References.Core/Interfaces/Repositories/IReferenceUsageRepository.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 |
---|---|---|
@@ -1,19 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Nbic.References.Core.Models; | ||
using Nbic.References.Core.Models; | ||
|
||
namespace Nbic.References.Core.Interfaces.Repositories | ||
namespace Nbic.References.Core.Interfaces.Repositories; | ||
|
||
public interface IReferenceUsageRepository : IRepository<ReferenceUsage> | ||
{ | ||
public interface IReferenceUsageRepository : IRepository<ReferenceUsage> | ||
{ | ||
Task<List<ReferenceUsage>> GetAll(int offset, int limit); | ||
Task<List<ReferenceUsage>> GetFromReferenceId(Guid referenceId); | ||
void DeleteForReference(Guid id); | ||
void DeleteUsage(Guid id, int applicationId, Guid userId); | ||
Task Add(ReferenceUsage referenceUsage); | ||
Task<bool> AddRange(ReferenceUsage[] referenceUsages); | ||
} | ||
} | ||
Task<List<ReferenceUsage>> GetAll(int offset, int limit); | ||
Task<List<ReferenceUsage>> GetFromReferenceId(Guid referenceId); | ||
void DeleteForReference(Guid id); | ||
void DeleteUsage(Guid id, int applicationId, Guid userId); | ||
Task Add(ReferenceUsage referenceUsage); | ||
Task<bool> AddRange(IEnumerable<ReferenceUsage> referenceUsages); | ||
} |
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
8 changes: 4 additions & 4 deletions
8
Nbic.References.Infrastructure/Nbic.References.Infrastructure.csproj
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
6 changes: 2 additions & 4 deletions
6
.../Repositories/DbContext/Migrations/SqlServerMigrations/20200203141446_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
126 changes: 62 additions & 64 deletions
126
...structure/Repositories/DbContext/Migrations/SqlServerMigrations/20200203141446_Initial.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 |
---|---|---|
@@ -1,72 +1,70 @@ | ||
using System; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace Nbic.References.EFCore.Migrations.SqlServerMigrations | ||
namespace Nbic.References.Infrastructure.Repositories.DbContext.Migrations.SqlServerMigrations; | ||
|
||
public partial class Initial : Migration | ||
{ | ||
public partial class Initial : Migration | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Reference", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(nullable: false), | ||
ApplicationId = table.Column<int>(nullable: true), | ||
UserId = table.Column<Guid>(nullable: false), | ||
Author = table.Column<string>(unicode: false, nullable: true), | ||
Year = table.Column<string>(unicode: false, nullable: true), | ||
Title = table.Column<string>(unicode: false, nullable: true), | ||
Summary = table.Column<string>(unicode: false, nullable: true), | ||
Journal = table.Column<string>(unicode: false, nullable: true), | ||
Volume = table.Column<string>(unicode: false, nullable: true), | ||
Pages = table.Column<string>(unicode: false, nullable: true), | ||
Bibliography = table.Column<string>(unicode: false, nullable: true), | ||
Lastname = table.Column<string>(unicode: false, nullable: true), | ||
Middlename = table.Column<string>(unicode: false, nullable: true), | ||
Firstname = table.Column<string>(unicode: false, nullable: true), | ||
Url = table.Column<string>(unicode: false, nullable: true), | ||
Keywords = table.Column<string>(unicode: false, nullable: true), | ||
ReferenceString = table.Column<string>(nullable: true), | ||
EditDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "GetUtcDate()") | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Id", x => x.Id); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "Reference", | ||
columns: table => new | ||
{ | ||
Id = table.Column<Guid>(nullable: false), | ||
ApplicationId = table.Column<int>(nullable: true), | ||
UserId = table.Column<Guid>(nullable: false), | ||
Author = table.Column<string>(unicode: false, nullable: true), | ||
Year = table.Column<string>(unicode: false, nullable: true), | ||
Title = table.Column<string>(unicode: false, nullable: true), | ||
Summary = table.Column<string>(unicode: false, nullable: true), | ||
Journal = table.Column<string>(unicode: false, nullable: true), | ||
Volume = table.Column<string>(unicode: false, nullable: true), | ||
Pages = table.Column<string>(unicode: false, nullable: true), | ||
Bibliography = table.Column<string>(unicode: false, nullable: true), | ||
Lastname = table.Column<string>(unicode: false, nullable: true), | ||
Middlename = table.Column<string>(unicode: false, nullable: true), | ||
Firstname = table.Column<string>(unicode: false, nullable: true), | ||
Url = table.Column<string>(unicode: false, nullable: true), | ||
Keywords = table.Column<string>(unicode: false, nullable: true), | ||
ReferenceString = table.Column<string>(nullable: true), | ||
EditDate = table.Column<DateTime>(type: "datetime", nullable: false, defaultValueSql: "GetUtcDate()") | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Id", x => x.Id); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "ReferenceUsage", | ||
columns: table => new | ||
{ | ||
ReferenceId = table.Column<Guid>(nullable: false), | ||
ApplicationId = table.Column<int>(nullable: false), | ||
UserId = table.Column<Guid>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_ReferenceUsage", x => new { x.ReferenceId, x.ApplicationId, x.UserId }); | ||
table.ForeignKey( | ||
name: "FK_ReferenceUsage_Reference", | ||
column: x => x.ReferenceId, | ||
principalTable: "Reference", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
migrationBuilder.CreateTable( | ||
name: "ReferenceUsage", | ||
columns: table => new | ||
{ | ||
ReferenceId = table.Column<Guid>(nullable: false), | ||
ApplicationId = table.Column<int>(nullable: false), | ||
UserId = table.Column<Guid>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_ReferenceUsage", x => new { x.ReferenceId, x.ApplicationId, x.UserId }); | ||
table.ForeignKey( | ||
name: "FK_ReferenceUsage_Reference", | ||
column: x => x.ReferenceId, | ||
principalTable: "Reference", | ||
principalColumn: "Id", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_UserId_ApplicationId", | ||
table: "Reference", | ||
columns: new[] { "UserId", "ApplicationId" }); | ||
} | ||
migrationBuilder.CreateIndex( | ||
name: "IX_UserId_ApplicationId", | ||
table: "Reference", | ||
columns: ["UserId", "ApplicationId"]); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ReferenceUsage"); | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "ReferenceUsage"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "Reference"); | ||
} | ||
migrationBuilder.DropTable( | ||
name: "Reference"); | ||
} | ||
} | ||
} |
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
6 changes: 2 additions & 4 deletions
6
...ure/Repositories/DbContext/Migrations/SqliteMigrations/20200203141321_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.