예제 #1
0
        /// <summary>
        /// Create a new userrole object.
        /// </summary>
        /// <param name="userRoleId">Initial value of the UserRoleId property.</param>
        /// <param name="roleId">Initial value of the RoleId property.</param>
        /// <param name="userId">Initial value of the UserId property.</param>
        public static userrole Createuserrole(global::System.Int64 userRoleId, global::System.Int64 roleId, global::System.Int64 userId)
        {
            userrole userrole = new userrole();

            userrole.UserRoleId = userRoleId;
            userrole.RoleId     = roleId;
            userrole.UserId     = userId;
            return(userrole);
        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the userroles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTouserroles(userrole userrole)
 {
     base.AddObject("userroles", userrole);
 }
 /// <summary>
 /// Create a new userrole object.
 /// </summary>
 /// <param name="userRoleId">Initial value of the UserRoleId property.</param>
 /// <param name="roleId">Initial value of the RoleId property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 public static userrole Createuserrole(global::System.Int64 userRoleId, global::System.Int64 roleId, global::System.Int64 userId)
 {
     userrole userrole = new userrole();
     userrole.UserRoleId = userRoleId;
     userrole.RoleId = roleId;
     userrole.UserId = userId;
     return userrole;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the userroles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTouserroles(userrole userrole)
 {
     base.AddObject("userroles", userrole);
 }
 /// <summary>
 /// Method that saves new UserRole data into the 'userroles' table. 
 /// </summary>
 /// <param name="newUserRole"></param>
 public void SaveUserRole(userrole newUserRole)
 {
     using (var context = new TreasureHuntEntities())
     {
         context.userroles.AddObject(newUserRole);
         context.SaveChanges();
         context.ObjectStateManager.ChangeObjectState(newUserRole, System.Data.EntityState.Added);
     }
 }