예제 #1
0
        protected override T CreateOneItem <T>(int id, string name, ContentItem parent)
        {
            var item = base.CreateOneItem <T>(id, name, parent);

            repository.SaveOrUpdate(item);
            return(item);
        }
예제 #2
0
        protected T CreateItem <T>(int id, string name, ContentItem parent) where T : ContentItem, new()
        {
            T i = new T();

            i.Name  = name;
            i.ID    = id;
            i.State = ContentState.Published;
            i.AddTo(parent);
            repository.SaveOrUpdate(i);
            return(i);
        }