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
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Movies.Core.Entities; | |
using Movies.Core.Repositories.Base; | |
namespace Movies.Core.Repositories | |
{ | |
public interface IMovieRepository : IRepository<Movie> | |
{ | |
// Custom operations can go here |
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
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Movies.Core.Entities.Base; | |
namespace Movies.Core.Repositories.Base | |
{ | |
public interface IRepository<T> where T : Entity | |
{ | |
Task<IReadOnlyList<T>> GetAllAsync(); | |
Task<T> GetByIdAsync(int id); |
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
using Movies.Core.Entities.Base; | |
namespace Movies.Core.Entities | |
{ | |
public class Movie : Entity | |
{ | |
public string MovieName { get; set; } | |
public string DirectorName { get; set; } | |
public string ReleaseYear { get; set; } | |
} |
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
namespace Movies.Core.Entities.Base | |
{ | |
public abstract class Entity:EntityBase<int> | |
{ | |
} | |
} |
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
namespace Movies.Core.Entities.Base | |
{ | |
public abstract class EntityBase<TId>: IEntityBase<TId> | |
{ | |
public virtual TId Id { get; protected set; } | |
} | |
} |
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
namespace Movies.Core.Entities.Base | |
{ | |
public interface IEntityBase<TId> | |
{ | |
TId Id { get; } | |
} | |
} |
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
<ItemGroup> | |
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.0.1" /> | |
<PackageReference Include="MediatR" Version="9.0.0" /> | |
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> | |
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" /> | |
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.1.1" /> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.7"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
</PackageReference> |
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
<ItemGroup> | |
<PackageReference Include="AutoMapper" Version="10.1.1" /> | |
<PackageReference Include="FluentValidation" Version="9.2.2" /> | |
<PackageReference Include="MediatR" Version="9.0.0" /> | |
</ItemGroup> |
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
<ItemGroup> | |
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.9" /> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.9"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
</PackageReference> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.9" /> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.9" /> | |
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.9"> | |
<PrivateAssets>all</PrivateAssets> |
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
{ | |
"Routes": [ | |
{ | |
"DownstreamPathTemplate": "/api/v1/movies", | |
"DownstreamScheme": "https", | |
"DownstreamHostAndPorts": [ | |
{ | |
"Host": "localhost", | |
"Port": 5001 | |
} |