diff --git a/src/FilterLists.Api/Startup.cs b/src/FilterLists.Api/Startup.cs index e9997223e..e1dd15e4c 100644 --- a/src/FilterLists.Api/Startup.cs +++ b/src/FilterLists.Api/Startup.cs @@ -30,10 +30,7 @@ public void Configure(IApplicationBuilder app) }); app.UseSwagger(); - app.UseSwaggerUI(c => - { - c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1"); - }); + app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "FilterLists API V1"); }); app.UseMvc(); } diff --git a/src/FilterLists.Data/Contexts/FilterListsDbContext.cs b/src/FilterLists.Data/Contexts/FilterListsDbContext.cs index 58aa4dee2..fca7cd312 100644 --- a/src/FilterLists.Data/Contexts/FilterListsDbContext.cs +++ b/src/FilterLists.Data/Contexts/FilterListsDbContext.cs @@ -1,4 +1,4 @@ -using FilterLists.Data.Models.Implementations; +using FilterLists.Data.Entities; using Microsoft.EntityFrameworkCore; namespace FilterLists.Data.Contexts diff --git a/src/FilterLists.Data/Contexts/IFilterListsDbContext.cs b/src/FilterLists.Data/Contexts/IFilterListsDbContext.cs index f1eb57116..cedf781ae 100644 --- a/src/FilterLists.Data/Contexts/IFilterListsDbContext.cs +++ b/src/FilterLists.Data/Contexts/IFilterListsDbContext.cs @@ -1,4 +1,4 @@ -using FilterLists.Data.Models.Implementations; +using FilterLists.Data.Entities; using Microsoft.EntityFrameworkCore; namespace FilterLists.Data.Contexts diff --git a/src/FilterLists.Data/Models/Implementations/BaseEntity.cs b/src/FilterLists.Data/Entities/BaseEntity.cs similarity index 75% rename from src/FilterLists.Data/Models/Implementations/BaseEntity.cs rename to src/FilterLists.Data/Entities/BaseEntity.cs index aca2065e5..7f34685bc 100644 --- a/src/FilterLists.Data/Models/Implementations/BaseEntity.cs +++ b/src/FilterLists.Data/Entities/BaseEntity.cs @@ -1,12 +1,11 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using FilterLists.Data.Models.Contracts; using Newtonsoft.Json; -namespace FilterLists.Data.Models.Implementations +namespace FilterLists.Data.Entities { - public abstract class BaseEntity : IBaseEntity + public abstract class BaseEntity { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] diff --git a/src/FilterLists.Data/Models/Implementations/FilterList.cs b/src/FilterLists.Data/Entities/FilterList.cs similarity index 59% rename from src/FilterLists.Data/Models/Implementations/FilterList.cs rename to src/FilterLists.Data/Entities/FilterList.cs index 6c288f845..e9af96704 100644 --- a/src/FilterLists.Data/Models/Implementations/FilterList.cs +++ b/src/FilterLists.Data/Entities/FilterList.cs @@ -1,19 +1,19 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using FilterLists.Data.Models.Contracts; using Newtonsoft.Json; -namespace FilterLists.Data.Models.Implementations +namespace FilterLists.Data.Entities { - public class FilterList : BaseEntity, IFilterList + public class FilterList : BaseEntity { public List Languages { get; set; } [JsonIgnore] public virtual Maintainer Maintainer { get; set; } - [Description(@"A brief description of the list's functionality. Preferably, this is quoted (if non-English, translate to English via translator or Google Translate for consistency) from the list's documentation or composed by a maintainer of the list. If neither are available, a generic description should be composed by the FilterLists contributor.")] + [Description( + @"A brief description of the list's functionality. Preferably, this is quoted (if non-English, translate to English via translator or Google Translate for consistency) from the list's documentation or composed by a maintainer of the list. If neither are available, a generic description should be composed by the FilterLists contributor.")] [MaxLength(1022)] public string Description { get; set; } @@ -23,7 +23,8 @@ public class FilterList : BaseEntity, IFilterList [MinLength(6)] public string DescriptionSourceUrl { get; set; } - [Description(@"The URL to the list's donation page. This could be a custom PayPal or similar link, or a link to a web page discussing various donation options. Pull requests that include changes to this link will undergo further verification to prevent fraud.")] + [Description( + @"The URL to the list's donation page. This could be a custom PayPal or similar link, or a link to a web page discussing various donation options. Pull requests that include changes to this link will undergo further verification to prevent fraud.")] [Url] [MaxLength(2083)] [MinLength(6)] @@ -41,7 +42,8 @@ public class FilterList : BaseEntity, IFilterList [MinLength(6)] public string ForumUrl { get; set; } - [Description(@"The URL to the list's home page. Preferably, this is stated in the header of the list. Alternatively, it could be a custom domain, GitHub page, blog post, forum post, etc. that serves as a primary source of information for the list.")] + [Description( + @"The URL to the list's home page. Preferably, this is stated in the header of the list. Alternatively, it could be a custom domain, GitHub page, blog post, forum post, etc. that serves as a primary source of information for the list.")] [Url] [MaxLength(2083)] [MinLength(6)] @@ -58,7 +60,8 @@ public class FilterList : BaseEntity, IFilterList [MaxLength(126)] public string Name { get; set; } - [Description(@"The URL to the list in raw text format. zip files and other formats are acceptable if no text format is available.")] + [Description( + @"The URL to the list in raw text format. zip files and other formats are acceptable if no text format is available.")] [Required] [Url] [MaxLength(2083)] diff --git a/src/FilterLists.Data/Models/Implementations/Language.cs b/src/FilterLists.Data/Entities/Language.cs similarity index 69% rename from src/FilterLists.Data/Models/Implementations/Language.cs rename to src/FilterLists.Data/Entities/Language.cs index c2e86e0fc..686fc0679 100644 --- a/src/FilterLists.Data/Models/Implementations/Language.cs +++ b/src/FilterLists.Data/Entities/Language.cs @@ -1,8 +1,6 @@ -using FilterLists.Data.Models.Contracts; - -namespace FilterLists.Data.Models.Implementations +namespace FilterLists.Data.Entities { - public class Language : BaseEntity, ILanguage + public class Language : BaseEntity { public string Iso6391 { get; set; } public string Iso6392 { get; set; } diff --git a/src/FilterLists.Data/Models/Implementations/Maintainer.cs b/src/FilterLists.Data/Entities/Maintainer.cs similarity index 85% rename from src/FilterLists.Data/Models/Implementations/Maintainer.cs rename to src/FilterLists.Data/Entities/Maintainer.cs index 1301ec337..1f4fbdbee 100644 --- a/src/FilterLists.Data/Models/Implementations/Maintainer.cs +++ b/src/FilterLists.Data/Entities/Maintainer.cs @@ -1,11 +1,10 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using FilterLists.Data.Models.Contracts; -namespace FilterLists.Data.Models.Implementations +namespace FilterLists.Data.Entities { - public class Maintainer : BaseEntity, IMaintainer + public class Maintainer : BaseEntity { public List FilterLists { get; set; } diff --git a/src/FilterLists.Data/Json/JsonSampleGenerator.cs b/src/FilterLists.Data/Json/JsonSampleGenerator.cs index b41cc79ca..5f7b1319e 100644 --- a/src/FilterLists.Data/Json/JsonSampleGenerator.cs +++ b/src/FilterLists.Data/Json/JsonSampleGenerator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using FilterLists.Data.Models.Implementations; +using FilterLists.Data.Entities; using Newtonsoft.Json.Linq; namespace FilterLists.Data.Json diff --git a/src/FilterLists.Data/Json/JsonSchemaGenerator.cs b/src/FilterLists.Data/Json/JsonSchemaGenerator.cs index 1c5e7f92b..db3abd56e 100644 --- a/src/FilterLists.Data/Json/JsonSchemaGenerator.cs +++ b/src/FilterLists.Data/Json/JsonSchemaGenerator.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics; using System.IO; -using FilterLists.Data.Models.Implementations; +using FilterLists.Data.Entities; using Newtonsoft.Json.Schema.Generation; namespace FilterLists.Data.Json diff --git a/src/FilterLists.Data/Models/Contracts/IBaseEntity.cs b/src/FilterLists.Data/Models/Contracts/IBaseEntity.cs deleted file mode 100644 index b78844b56..000000000 --- a/src/FilterLists.Data/Models/Contracts/IBaseEntity.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace FilterLists.Data.Models.Contracts -{ - public interface IBaseEntity - { - long Id { get; set; } - DateTime CreatedDateUtc { get; set; } - DateTime? ModifiedDateUtc { get; set; } - } -} \ No newline at end of file diff --git a/src/FilterLists.Data/Models/Contracts/IFilterList.cs b/src/FilterLists.Data/Models/Contracts/IFilterList.cs deleted file mode 100644 index a8889d30e..000000000 --- a/src/FilterLists.Data/Models/Contracts/IFilterList.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace FilterLists.Data.Models.Contracts -{ - public interface IFilterList - { - string Description { get; set; } - string DescriptionSourceUrl { get; set; } - string DonateUrl { get; set; } - string Email { get; set; } - string ForumUrl { get; set; } - string HomeUrl { get; set; } - string IssuesUrl { get; set; } - string Name { get; set; } - string ViewUrl { get; set; } - } -} \ No newline at end of file diff --git a/src/FilterLists.Data/Models/Contracts/ILanguage.cs b/src/FilterLists.Data/Models/Contracts/ILanguage.cs deleted file mode 100644 index 8fb69b0dc..000000000 --- a/src/FilterLists.Data/Models/Contracts/ILanguage.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace FilterLists.Data.Models.Contracts -{ - public interface ILanguage - { - string Iso6391 { get; set; } - string Iso6392 { get; set; } - string Iso6392B { get; set; } - string Iso6392T { get; set; } - string Iso6393 { get; set; } - string LocalName { get; set; } - string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/FilterLists.Data/Models/Contracts/IMaintainer.cs b/src/FilterLists.Data/Models/Contracts/IMaintainer.cs deleted file mode 100644 index 8287e7bc1..000000000 --- a/src/FilterLists.Data/Models/Contracts/IMaintainer.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace FilterLists.Data.Models.Contracts -{ - public interface IMaintainer - { - string Email { get; set; } - string HomeUrl { get; set; } - string Name { get; set; } - string TwitterHandle { get; set; } - } -} \ No newline at end of file diff --git a/src/FilterLists.Data/Repositories/Contracts/IFilterListRepository.cs b/src/FilterLists.Data/Repositories/Contracts/IFilterListRepository.cs index 4aef879cc..49a1a7344 100644 --- a/src/FilterLists.Data/Repositories/Contracts/IFilterListRepository.cs +++ b/src/FilterLists.Data/Repositories/Contracts/IFilterListRepository.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; -using FilterLists.Data.Models.Contracts; +using FilterLists.Data.Entities; namespace FilterLists.Data.Repositories.Contracts { public interface IFilterListRepository { - IEnumerable GetAll(); - IFilterList GetByName(string filterListName); + IEnumerable GetAll(); + FilterList GetByName(string filterListName); } } \ No newline at end of file diff --git a/src/FilterLists.Data/Repositories/Implementations/FilterListRepository.cs b/src/FilterLists.Data/Repositories/Implementations/FilterListRepository.cs index 223d4b6a4..4f1503097 100644 --- a/src/FilterLists.Data/Repositories/Implementations/FilterListRepository.cs +++ b/src/FilterLists.Data/Repositories/Implementations/FilterListRepository.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using FilterLists.Data.Contexts; -using FilterLists.Data.Models.Contracts; +using FilterLists.Data.Entities; using FilterLists.Data.Repositories.Contracts; namespace FilterLists.Data.Repositories.Implementations @@ -15,12 +15,12 @@ public FilterListRepository(FilterListsDbContext filterListsDbContext) this.filterListsDbContext = filterListsDbContext; } - public IEnumerable GetAll() + public IEnumerable GetAll() { return filterListsDbContext.FilterLists.AsEnumerable(); } - public IFilterList GetByName(string filterListName) + public FilterList GetByName(string filterListName) { return filterListsDbContext.FilterLists.First(x => x.Name == filterListName); } diff --git a/src/FilterLists.Services/Contracts/IFilterListService.cs b/src/FilterLists.Services/Contracts/IFilterListService.cs index 457874c46..3e929733b 100644 --- a/src/FilterLists.Services/Contracts/IFilterListService.cs +++ b/src/FilterLists.Services/Contracts/IFilterListService.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using FilterLists.Data.Models.Contracts; namespace FilterLists.Services.Contracts { diff --git a/src/FilterLists.Services/Implementations/FilterListService.cs b/src/FilterLists.Services/Implementations/FilterListService.cs index c2553189c..6b045c164 100644 --- a/src/FilterLists.Services/Implementations/FilterListService.cs +++ b/src/FilterLists.Services/Implementations/FilterListService.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using FilterLists.Data.Models.Contracts; using FilterLists.Data.Repositories.Contracts; using FilterLists.Services.Contracts;