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 MediatR; | |
using Movies.Application.Responses; | |
namespace Movies.Application.Queries | |
{ | |
public class GetMoviesByDirectorNameQuery : IRequest<IEnumerable<MovieResponse>> | |
{ | |
public string DirectorName { 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
using AutoMapper; | |
using Movies.Application.Commands; | |
using Movies.Application.Responses; | |
using Movies.Core.Entities; | |
namespace Movies.Application.Mappers | |
{ | |
public class MovieMappingProfile : Profile | |
{ | |
public MovieMappingProfile() |
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; | |
using AutoMapper; | |
namespace Movies.Application.Mappers | |
{ | |
public class MovieMapper | |
{ | |
private static readonly Lazy<IMapper> Lazy = new Lazy<IMapper>(() => | |
{ | |
var config = new MapperConfiguration(cfg => |
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; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MediatR; | |
using Movies.Application.Commands; | |
using Movies.Application.Mappers; | |
using Movies.Application.Responses; | |
using Movies.Core.Entities; | |
using Movies.Core.Repositories; |
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.Application.Responses | |
{ | |
public class MovieResponse | |
{ | |
public int Id { get; set; } | |
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
using MediatR; | |
using Movies.Application.Responses; | |
namespace Movies.Application.Commands | |
{ | |
public class CreateMovieCommand : IRequest<MovieResponse> | |
{ | |
public string MovieName { get; set; } | |
public string DirectorName { 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
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore; | |
using Movies.Core.Entities; | |
using Movies.Core.Repositories; | |
using Movies.Infrastructure.Data; | |
using Movies.Infrastructure.Repositories.Base; | |
namespace Movies.Infrastructure.Repositories |
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 Microsoft.EntityFrameworkCore; | |
using Movies.Core.Entities.Base; | |
using Movies.Core.Repositories.Base; | |
using Movies.Infrastructure.Data; | |
namespace Movies.Infrastructure.Repositories.Base | |
{ | |
public class Repository<T> : IRepository<T> where 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
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.EntityFrameworkCore.Internal; | |
using Microsoft.Extensions.Logging; | |
using Movies.Core.Entities; | |
namespace Movies.Infrastructure.Data | |
{ | |
public class MovieContextSeed |
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 Microsoft.EntityFrameworkCore; | |
using Movies.Core.Entities; | |
namespace Movies.Infrastructure.Data | |
{ | |
public class MovieContext : DbContext | |
{ | |
public MovieContext(DbContextOptions<MovieContext> options):base(options) | |
{ | |