コード例 #1
0
        private void CreateWebsite(string name, StructureInfo structureInfo)
        {
            var website = structureInfo.Website.Website.MakeWritableClone();

            website.Id = _slugifyService.Slugify(CultureInfo.CurrentCulture, name).NullIfEmpty();
            foreach (var language in _languageService.GetAll())
            {
                website.Localizations[language.CultureInfo].Name = name;
            }
            website.SystemId = structureInfo.Id(website.SystemId);
            website.FieldTemplateSystemId = structureInfo.Id(website.FieldTemplateSystemId);
            _websiteService.Create(website);
            structureInfo.Website.Website = website;
        }
コード例 #2
0
        public ActionResult <Website> Create(Website website)
        {
            _websiteService.Create(website);

            return(CreatedAtRoute("GetBook", new { id = website.Id.ToString() }, website));
        }