-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Olhaholiak/categories renaming (#181)
* renamed entities * migrations * added swagger grouping * deleted dead usings, separated the interfase
- Loading branch information
1 parent
9f0f657
commit 255bd7a
Showing
60 changed files
with
3,199 additions
and
1,794 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
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
22 changes: 22 additions & 0 deletions
22
OutOfSchool/OutOfSchool.DataAccess/Repository/ClassRepository.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Linq; | ||
using OutOfSchool.Services.Models; | ||
|
||
namespace OutOfSchool.Services.Repository | ||
{ | ||
public class ClassRepository : EntityRepository<Class>, IClassRepository | ||
{ | ||
private readonly OutOfSchoolDbContext db; | ||
|
||
public ClassRepository(OutOfSchoolDbContext dbContext) | ||
: base(dbContext) | ||
{ | ||
db = dbContext; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public bool SameExists(Class entity) => db.Classes.Any(x => (x.Title == entity.Title) && (x.DepartmentId == entity.DepartmentId)); | ||
|
||
/// <inheritdoc/> | ||
public bool DepartmentExists(long id) => db.Departments.Any(x => x.Id == id); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
OutOfSchool/OutOfSchool.DataAccess/Repository/DepartmentRepository.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Linq; | ||
using OutOfSchool.Services.Models; | ||
|
||
namespace OutOfSchool.Services.Repository | ||
{ | ||
public class DepartmentRepository : EntityRepository<Department>, IDepartmentRepository | ||
{ | ||
private readonly OutOfSchoolDbContext db; | ||
|
||
public DepartmentRepository(OutOfSchoolDbContext dbContext) | ||
: base(dbContext) | ||
{ | ||
db = dbContext; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public bool SameExists(Department entity) => db.Departments.Any(x => (x.Title == entity.Title) && (x.DirectionId == entity.DirectionId)); | ||
|
||
/// <inheritdoc/> | ||
public bool DirectionExists(long id) => db.Directions.Any(x => x.Id == id); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
OutOfSchool/OutOfSchool.DataAccess/Repository/IClassRepository.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using OutOfSchool.Services.Models; | ||
|
||
namespace OutOfSchool.Services.Repository | ||
{ | ||
public interface IClassRepository : IEntityRepository<Class>, IExistable<Class> | ||
{ | ||
/// <summary> | ||
/// Checks entity departmentId existens. | ||
/// </summary> | ||
/// <param name="id">Department id.</param> | ||
/// <returns>Bool.</returns> | ||
bool DepartmentExists(long id); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
OutOfSchool/OutOfSchool.DataAccess/Repository/IDepartmentRepository.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using OutOfSchool.Services.Models; | ||
|
||
namespace OutOfSchool.Services.Repository | ||
{ | ||
public interface IDepartmentRepository : IEntityRepository<Department>, IExistable<Department> | ||
{ | ||
/// <summary> | ||
/// Checks entity directionId existens. | ||
/// </summary> | ||
/// <param name="id">Direction id.</param> | ||
/// <returns>Bool.</returns> | ||
bool DirectionExists(long id); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
OutOfSchool/OutOfSchool.DataAccess/Repository/IExistable.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace OutOfSchool.Services.Repository | ||
{ | ||
public interface IExistable<in T> | ||
{ | ||
/// <summary> | ||
/// Checks entity elements for uniqueness. | ||
/// </summary> | ||
/// <param name="entity">Entity.</param> | ||
/// <returns>Bool.</returns> | ||
bool SameExists(T entity); | ||
} | ||
} |
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
14 changes: 0 additions & 14 deletions
14
OutOfSchool/OutOfSchool.DataAccess/Repository/ISubcategoryRepository.cs
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
OutOfSchool/OutOfSchool.DataAccess/Repository/ISubsubcategoryRepository.cs
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.