Пример #1
0
        public Language Add(Language language)
        {
            using (var db = new DvdRentalDbContext())
            {
                db.Languages.Add(language);
                db.SaveChanges();
            }

            return(language);
        }
Пример #2
0
        public List <Language> GetAllLanguages()
        {
            var listing = new List <Language>();

            using (var db = new DvdRentalDbContext())
            {
                listing = db.Languages.ToList();
            }

            return(listing);
        }
Пример #3
0
        public Language Update(Language language)
        {
            using (var db = new DvdRentalDbContext())
            {
                var updateLanguage = db.Languages.FirstOrDefault(f => f.language_id == language.language_id);

                updateLanguage.name        = language.name;
                updateLanguage.last_update = language.last_update;

                db.SaveChanges();
            }

            return(language);
        }
        public List <Film> GetAllFilms()
        {
            var listing = new List <Film>();

            using (var db = new DvdRentalDbContext())
            {
                listing = db.Films.ToList();

                //var sqlCommand = "select get_film()";
                //var filmListing = db.Database.SqlQuery<FileModel>(sqlCommand).ToList();
            }


            return(listing);
        }