Example #1
0
        public async Task <bool> AddNewSiteTemplate(SiteTemplateModel site)
        {
            await this.templateRepo.AddAsync(SiteTemplateMapping.MapTemplateModelToTemplate(site));

            await this.templateRepo.CommitAsync();

            return(await Task.FromResult(true));
        }
Example #2
0
        public async Task <bool> UpdateSiteTemplate(SiteTemplateModel site)
        {
            var siteEntity = await this.templateRepo.GetSingleAsync(s => site.TemplateId == s.TemplateId);

            if (siteEntity != null)
            {
                SiteTemplateMapping.MapTemplateModelToExistingTemplate(site, siteEntity);
            }

            await this.templateRepo.CommitAsync();

            return(await Task.FromResult(true));
        }