/// <summary> /// Adds a single report role to the repository /// </summary> /// <param name="assignment">The assignment to add</param> public void AddAssignment ( ReportRoleAssignment assignment ) { Validate.IsNotNull(assignment); _context.Set <ReportRoleAssignment>().Add ( assignment ); }
/// <summary> /// Updates a single report role assignment to the repository /// </summary> /// <param name="assignment">The assignment to update</param> public void UpdateAssignment ( ReportRoleAssignment assignment ) { Validate.IsNotNull(assignment); var entry = _context.Entry <ReportRoleAssignment> ( assignment ); entry.State = EntityState.Modified; }
/// <summary> /// Removes a single report role assignment from the repository /// </summary> /// <param name="assignment">The assignment</param> private void RemoveAssignment ( ReportRoleAssignment assignment ) { var entry = _context.Entry <ReportRoleAssignment> ( assignment ); // Ensure the entity has been attached to the object state manager if (entry.State == EntityState.Detached) { _context.Set <ReportRoleAssignment>().Attach ( assignment ); } _context.Set <ReportRoleAssignment>().Remove ( assignment ); }