Exemple #1
0
        /// <summary>
        /// Sets the value of the field.
        /// </summary>
        /// <param name="value">
        /// The value.
        /// </param>
        /// <param name="identity">
        /// The identity setting the value.
        /// </param>
        /// <returns>
        /// The current <see cref="FieldValue"/>.
        /// </returns>
        public FieldValue Set(object value, DomainIdentity identity)
        {
            this.elements.Clear();

            if (value is ICollection list)
            {
                foreach (var item in list)
                {
                    var element = new FieldValueElement(item);
                    this.elements.Add(element);
                    element.AddToValue(this);
                }
            }
            else
            {
                var element = new FieldValueElement(value);
                this.elements.Add(element);
                element.AddToValue(this);
            }

            this.LastModifiedBy = identity;

            // Reducing resolution for the purposes of PostgreSQL compatibility.
            var now = DateTimeOffset.Now;

            this.LastModifiedTime = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond, now.Offset);
            return(this);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericSubmission"/> class.
 /// </summary>
 /// <param name="subject">
 /// The subject.
 /// </param>
 /// <param name="submittedBy">
 /// The submitted by identity.
 /// </param>
 /// <param name="genericSubmissionId">
 /// The generic Submission ID.
 /// </param>
 public GenericSubmission(string subject, DomainIdentity submittedBy, int genericSubmissionId)
     : this(subject, submittedBy)
 {
     this.GenericSubmissionId = genericSubmissionId;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericSubmission"/> class.
 /// </summary>
 /// <param name="subject">
 /// The subject.
 /// </param>
 /// <param name="submittedBy">
 /// The submitted by identity.
 /// </param>
 public GenericSubmission(string subject, DomainIdentity submittedBy)
 {
     this.Subject     = subject;
     this.SubmittedBy = submittedBy;
 }