/// <summary> /// Method to create argument fault. /// </summary> /// <param name="message">Fault message.</param> /// <param name="paramName">Parameter that caused the fault.</param> /// <returns>Argument fault.</returns> internal static ArgumentFault CreateArgumentFault(string message, string paramName) { Debug.Assert(!String.IsNullOrEmpty(message), "Provide a valid message string"); Debug.Assert(!String.IsNullOrEmpty(paramName), "Provide a valid param name"); ArgumentFault argFault = new ArgumentFault(); argFault.Message = message; argFault.ParamName = paramName; argFault.Source = FaultSource.Client; return(argFault); }
public void UpdateUser(UserDto user) { if (user == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(user) }; throw new FaultException <ArgumentFault>(fault); } ApplicationUser userEntity = Mapper.Map <ApplicationUser>(user); _userBusinessLogic.UpdateUser(userEntity); }
public void UpdateProgram(RobotProgramDto program) { if (program == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(program) }; throw new FaultException <ArgumentFault>(fault); } RobotProgram programEntity = Mapper.Map <RobotProgram>(program); _robotProgramBusinessLogic.UpdateProgram(programEntity); }
public void UpdateStep(ProgramStepDto step) { if (step == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(step) }; throw new FaultException <ArgumentFault>(fault); } ProgramStep stepEntity = Mapper.Map <ProgramStep>(step); _robotProgramBusinessLogic.UpdateStep(stepEntity); }
public void CreateRole(RoleDto role) { // TODO: Move that validation to business logic layer ? if (role == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(role) }; throw new FaultException <ArgumentFault>(fault); } IdentityRole userEntity = Mapper.Map <IdentityRole>(role); _rolesBusinessLogic.CreateRole(userEntity); }
public void UpdateJointPoint(JointPointDto point) { // TODO: null-possibility should rather be checked in Buisness logic, and here just try-catch-toFaultConv if (point == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(point) }; throw new FaultException <ArgumentFault>(fault); } JointPoint pointEntity = Mapper.Map <JointPoint>(point); _robotProgramBusinessLogic.UpdateJointPoint(pointEntity); }
public void AddStep(ProgramStepDto step) { // TODO: null-possibility should rather be checked in Buisness logic, and here just try-catch-toFaultConv if (step == null) { var fault = new ArgumentFault { Message = "Argumnet is null", ArgumentName = nameof(step) }; throw new FaultException <ArgumentFault>(fault); } ProgramStep stepEntity = Mapper.Map <ProgramStep>(step); _robotProgramBusinessLogic.AddStep(stepEntity); }