public static void Initialize()
        {
            if (!_initialised)
            {
                AppContainer.Current.RegisterInstance <string>("DbConnectionString", "SakeDB");

                Database.SetInitializer <ArtistDbContext>(new CreateDatabaseIfNotExists <ArtistDbContext>());

                AppContainer.Current
                .RegisterType <ArtistDbContext>(new PerResolveLifetimeManager())
                .RegisterType <IArtistRepository, ArtistRepository>()
                .RegisterType <IArtistService, ArtistService>();

                ArtistAutoMapper.Initialize();
            }
            _initialised = true;
        }
Beispiel #2
0
 public bool SaveArtistInfo(ArtistDto artist)
 {
     return(_artistRepository.SaveArtistInfo(ArtistAutoMapper.ConvertToArtist(artist)));
 }
Beispiel #3
0
        public IEnumerable <ArtistDto> GetArtistsDetails()
        {
            var artists = _artistRepository.GetArtistsDetails();

            return(artists.Select(s => ArtistAutoMapper.ConvertToArtistDto(s)).ToList());
        }