Exemplo n.º 1
0
        protected override MovieCategory CreateNewObjectOverride()
        {
            MovieCategory category;

            using (NewNameGenerator <MovieCategory> generator = new NewNameGenerator <MovieCategory>(Session)) {
                category = new MovieCategory(Session, generator.RetrieveNewName());
            }
            return(category);
        }
Exemplo n.º 2
0
        public MovieCategory CreateCategory()
        {
            XPCollection <MovieCategory> categories = MovieCategoriesEdit.VRObjectsEditObject.VideoRentObjects;
            MovieCategory category;

            using (NewNameGenerator <MovieCategory> generator = new NewNameGenerator <MovieCategory>(categories)) {
                category = new MovieCategory(categories.Session, generator.RetrieveNewName());
            }
            categories.Add(category);
            MovieCategoriesEdit.CurrentRecord = category;
            return(category);
        }