/// <summary>
 /// Adds the references of the second arguement in the first one.
 /// </summary>
 /// <param name="messageTypeToPointSystem">The message type to point system to add the references in.</param>
 /// <param name="reference">The references.</param>
 /// <returns>The first arguement.</returns>
 private static Entites.MessageTypeToPointSystem AddReferences(
     Entites.MessageTypeToPointSystem messageTypeToPointSystem, Entites.MessageTypeToPointSystem reference)
 {
     messageTypeToPointSystem.MessageType = reference.MessageType;
     messageTypeToPointSystem.PointSystem = reference.PointSystem;
     return(messageTypeToPointSystem);
 }
 /// <summary>
 /// Clears the references of the message type to point system.
 /// </summary>
 /// <param name="messageTypeToPointSystem">The message type to point system.</param>
 /// <returns>A copy of the message type to point system given in entry with only the references.</returns>
 private static Entites.MessageTypeToPointSystem ClearReferences(
     Entites.MessageTypeToPointSystem messageTypeToPointSystem)
 {
     Entites.MessageTypeToPointSystem reference =
         new Entites.MessageTypeToPointSystem(messageTypeToPointSystem.PointSystem,
                                              messageTypeToPointSystem.MessageType, 0);
     messageTypeToPointSystem.MessageType = null;
     messageTypeToPointSystem.PointSystem = null;
     return(reference);
 }
 /// <summary>
 /// Creates the specified message type to point system.
 /// </summary>
 /// <param name="messageTypeToPointSystem">The message type to point system.</param>
 /// <returns>The same message type to point system.</returns>
 public static Entites.MessageTypeToPointSystem Create(Entites.MessageTypeToPointSystem messageTypeToPointSystem)
 {
     Entites.MessageTypeToPointSystem reference = ClearReferences(messageTypeToPointSystem);
     using (TerministratorContext context = new TerministratorContext(true))
     {
         context.MessageTypeToPointSystem.Add(messageTypeToPointSystem);
         context.SaveChanges();
     }
     return(AddReferences(messageTypeToPointSystem, reference));
 }
 /// <summary>
 /// Creates the specified message type to point system.
 /// </summary>
 /// <param name="messageTypeToPointSystem">The message type to point system.</param>
 /// <returns></returns>
 public static Entites.MessageTypeToPointSystem Create(Entites.MessageTypeToPointSystem messageTypeToPointSystem)
 {
     return(DAL.MessageTypeToPointSystem.Create(messageTypeToPointSystem));
 }