/// <summary> /// Deprecated Method for adding a new object to the companydetails EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTocompanydetails(companydetail companydetail) { base.AddObject("companydetails", companydetail); }
/// <summary> /// Create a new companydetail object. /// </summary> /// <param name="companyId">Initial value of the CompanyId property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="companyName">Initial value of the CompanyName property.</param> /// <param name="companyPassword">Initial value of the CompanyPassword property.</param> public static companydetail Createcompanydetail(global::System.Int64 companyId, global::System.Int64 userId, global::System.String companyName, global::System.String companyPassword) { companydetail companydetail = new companydetail(); companydetail.CompanyId = companyId; companydetail.UserId = userId; companydetail.CompanyName = companyName; companydetail.CompanyPassword = companyPassword; return companydetail; }
/// <summary> /// Method that saves company data into the 'companydetails' table. /// </summary> /// <param name="companyDetails"></param> public void saveCompany(companydetail companyDetails) { using(var context = new TreasureHuntEntities()) { context.companydetails.AddObject(companyDetails); context.SaveChanges(); context.ObjectStateManager.ChangeObjectState(companyDetails, System.Data.EntityState.Added); } }