Ejemplo n.º 1
0
 public SourceService(IRecipeSourceRepository rep, IRecipeRepository recipeRep, IMapper mapper, ILoggerFactory loggerFactory)
 {
     this._log              = loggerFactory.CreateLogger <SourceService>();
     this._mapper           = mapper;
     this._rep              = rep;
     this._recipeRep        = recipeRep;
     this._cookbookAdapter  = new BaseService <ICookbookSourceRepository, RecipeCookbookSource, CookbookSourceViewModel, CookbookSourceCreationViewModel>(_rep.CookbookSources, mapper, this._log, "cookbook source");
     this._webSourceAdapter = new BaseService <IWebSourceRepository, RecipeUrlSource, WebSourceViewModel, WebSourceCreationViewModel>(_rep.WebSources, mapper, _log, "web source");
 }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                this._rep.Dispose();
                this._recipeRep.Dispose();
            }

            this._log       = null;
            this._mapper    = null;
            this._rep       = null;
            this._recipeRep = null;
            _disposed       = true;
        }