Пример #1
0
        /// <summary>
        /// Add a program package to the database via Entityframework
        /// </summary>
        /// <param name="val"></param>
        /// <param name="db"></param>
        private static void AddProgramPackageToDatabase(XMLClasses.feedEntry val, ProgramContext db)
        {
            var program = new EF_Program {
                ProgramName = val.title.Value
            };

            if (program.ProgramVersions == null)
            {
                program.ProgramVersions = new List <EF_ProgramVersion>();
            }

            program.ProgramVersions.Add(new EF_ProgramVersion {
                Program = program, Version = val.properties.Version
            });

            db.Programs.Add(program);
        }
Пример #2
0
        private static IOrderedQueryable <EF_Program> GetStoredProgramPackagesFromDatabase(ProgramContext db, XMLClasses.feedEntry val)
        {
            var queryProgram = from p in db.Programs
                               where p.ProgramName == val.title.Value
                               orderby p.ProgramName
                               select p;

            return(queryProgram);
        }
Пример #3
0
        /// <summary>
        /// Add Program Package Version To the Database via Entityframework.
        /// The Program package version is allways linked to a Program package.
        /// </summary>
        /// <param name="queryProgram"></param>
        /// <param name="db"></param>
        /// <param name="val"></param>
        private static void AddProgramPackageVersionToDatabase(IOrderedQueryable <EF_Program> queryProgram, ProgramContext db, XMLClasses.feedEntry val)
        {
            var program = queryProgram.First();

            db.ProgramVersions.Add(new EF_ProgramVersion {
                Program = program, Version = val.properties.Version
            });
        }
Пример #4
0
        private static IQueryable <EF_ProgramVersion> GetStoredProgramPackageVersionsFromDatabase(ProgramContext db, XMLClasses.feedEntry val)
        {
            var queryProgramVersion = from p in db.ProgramVersions
                                      where p.Version == val.properties.Version
                                      select p;

            return(queryProgramVersion);
        }