Esempio n. 1
0
		public AddAuthorityGroupResponse AddAuthorityGroup(AddAuthorityGroupRequest request)
		{
			// create new group
			var authorityGroup = new AuthorityGroup();

			// set properties from request
			var assembler = new AuthorityGroupAssembler();
			assembler.UpdateAuthorityGroup(authorityGroup, request.AuthorityGroupDetail, PersistenceContext);

			// save
			PersistenceContext.Lock(authorityGroup, DirtyState.New);
			PersistenceContext.SynchState();

			return new AddAuthorityGroupResponse(assembler.CreateAuthorityGroupSummary(authorityGroup));
		}
		public AddAuthorityGroupResponse AddAuthorityGroup(AddAuthorityGroupRequest request)
		{
			Platform.CheckForNullReference(request, "request");
			Platform.CheckMemberIsSet(request.AuthorityGroupDetail, "AuthorityGroupDetail");

			if (request.AuthorityGroupDetail.BuiltIn)
				throw new RequestValidationException(SR.MessageCannotManageBuiltInAuthorityGroups);

			// create new group
			var authorityGroup = new AuthorityGroup();

			// set properties from request
			var assembler = new AuthorityGroupAssembler();
			assembler.UpdateAuthorityGroup(authorityGroup, request.AuthorityGroupDetail, PersistenceContext);

			// save
			PersistenceContext.Lock(authorityGroup, DirtyState.New);
			PersistenceContext.SynchState();

			return new AddAuthorityGroupResponse(assembler.CreateAuthorityGroupSummary(authorityGroup));
		}