mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add back commented dependencies, optimize references
This commit is contained in:
parent
21dccf4c9f
commit
624dcd2285
5 changed files with 20 additions and 25 deletions
|
|
@ -6,6 +6,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="10.4.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" />
|
||||
<PackageReference Include="SapientGuardian.EntityFrameworkCore.MySql" Version="7.1.23" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
//https://code.msdn.microsoft.com/Generic-Repository-Pattern-f133bca4/sourcecode?fileId=164016&pathId=1938870460
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
//using JetBrains.Annotations;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Models
|
||||
{
|
||||
|
|
@ -13,18 +10,18 @@ public abstract class BaseEntity
|
|||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public long Id { get; set; }
|
||||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
//TODO: Implement http://stackoverflow.com/a/38102266/2343739 so DefaultValue takes effect in db automatically
|
||||
//For now, manually execute on new tables: InitializeNewTableBaseEntityDefaults.sql
|
||||
[DefaultValue("CURRENT_TIMESTAMP")]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public DateTime AddedDateUtc { get; set; }
|
||||
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public DateTime? ModifiedDateUtc { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,53 +1,52 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
//using JetBrains.Annotations;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Models
|
||||
{
|
||||
public class List : BaseEntity
|
||||
{
|
||||
[MaxLength(1022)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string Description { get; set; }
|
||||
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string DescriptionSourceUrl { get; set; }
|
||||
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string DonateUrl { get; set; }
|
||||
|
||||
[MaxLength(126)]
|
||||
[MinLength(7)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string Email { get; set; }
|
||||
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string ForumUrl { get; set; }
|
||||
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string HomeUrl { get; set; }
|
||||
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string IssuesUrl { get; set; }
|
||||
|
||||
[MaxLength(126)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(2083)]
|
||||
[MinLength(6)]
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public string ViewUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -3,12 +3,11 @@
|
|||
using FilterLists.Data.Contexts;
|
||||
using FilterLists.Data.Models;
|
||||
using FilterLists.Data.Repositories.Contracts;
|
||||
|
||||
//using JetBrains.Annotations;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Data.Repositories.Implementations
|
||||
{
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public class ListRepository : IListRepository
|
||||
{
|
||||
private readonly FilterListsDbContext _filterListsDbContext;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
using FilterLists.Data.Models;
|
||||
using FilterLists.Data.Repositories.Contracts;
|
||||
using FilterLists.Services.Contracts;
|
||||
|
||||
//using JetBrains.Annotations;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace FilterLists.Services.Implementations
|
||||
{
|
||||
//[UsedImplicitly]
|
||||
[UsedImplicitly]
|
||||
public class ListService : IListService
|
||||
{
|
||||
private readonly IListRepository _listRepository;
|
||||
|
|
|
|||
Loading…
Reference in a new issue