public void AddValue(decimal idSchool, decimal idQuartersType, decimal area) { var sameSchoolQuarters = (from sq in EntitiesHolder.Entities.SchoolQuarters where sq.idSchool == idSchool && sq.idQuartersType == idQuartersType select sq).ToList(); if (sameSchoolQuarters.Count > 0) { throw new ValueAlreadyExistsException(); } SchoolQuarters schoolQuarters = new SchoolQuarters(); schoolQuarters.idSchool = idSchool; schoolQuarters.idQuartersType = idQuartersType; schoolQuarters.area = area; EntitiesHolder.Entities.SchoolQuarters.AddObject(schoolQuarters); EntitiesHolder.Entities.SaveChanges(); }
/// <summary> /// Deprecated Method for adding a new object to the SchoolQuarters EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSchoolQuarters(SchoolQuarters schoolQuarters) { base.AddObject("SchoolQuarters", schoolQuarters); }
/// <summary> /// Create a new SchoolQuarters object. /// </summary> /// <param name="idSchool">Initial value of the idSchool property.</param> /// <param name="idQuartersType">Initial value of the idQuartersType property.</param> public static SchoolQuarters CreateSchoolQuarters(global::System.Decimal idSchool, global::System.Decimal idQuartersType) { SchoolQuarters schoolQuarters = new SchoolQuarters(); schoolQuarters.idSchool = idSchool; schoolQuarters.idQuartersType = idQuartersType; return schoolQuarters; }