Esempio n. 1
0
 public AgentDocument(String firstName, String lastName, Version version, Id id)
 {
     this.FirstName = firstName;
     this.LastName  = lastName;
     this.Id        = id;
     this.Version   = version;
 }
 public LoginSessionDocument(Id sessionId, Guid userId, DateTime createDt, DateTime?logout, Version version)
 {
     SessionId    = sessionId;
     UserId       = userId;
     CreationTime = createDt;
     LogoutTime   = logout;
     Version      = version;
 }
Esempio n. 3
0
 public override void Load(UserDocument document)
 {
     id           = new Id(document.Id);
     version      = new Version(document.Version);
     username     = document.Username;
     email        = document.Email;
     passwordHash = document.PasswordHash;
     createDt     = document.CreationTime;
 }
Esempio n. 4
0
 public UserDocument(Id userId, String username, String email, String hash, DateTime createDate, Version version)
 {
     Id           = userId;
     Username     = username;
     Email        = email;
     PasswordHash = hash;
     CreationTime = createDate;
     Version      = version;
 }
Esempio n. 5
0
 public CustomerDocument(Id id, Version version, string name, Address billingAddress,
                         Address shippingAddress, Contact contact)
 {
     Id              = id;
     Version         = version;
     Name            = name;
     BillingAddress  = billingAddress;
     ShippingAddress = shippingAddress;
     Contact         = contact;
 }
 public ServiceRequest(ScheduledDate scheduledDate,
                       Id clientId, Id serviceId, Id assignedTo,
                       DueDate dueDate, Version version, Id id) : base(id, version)
 {
     this._scheduledDate = scheduledDate;
     this._clientId      = clientId;
     this._serviceId     = serviceId;
     this._dueDate       = dueDate;
     this._assignedTo    = assignedTo;
 }
Esempio n. 7
0
        public Version Lock(Version expectedVersion)
        {
            if (expectedVersion != version)
            {
                throw new InvalidOperationException(string.Format("The version is out of date and cannot be updated. Expected {0} was {1}", expectedVersion,
                                                                  version));
            }

            version++;

            return(version);
        }
        public override void Load(ServiceRequestDocument document)
        {
            id      = new Id(document.Id);
            version = new Version(document.Version);

            _scheduledDate  = new ScheduledDate(document.ScheduledDate);
            _dueDate        = new DueDate(document.DueDate);
            _completionDate = new CompletionDate(document.CompletionDate);

            _clientId   = new Id(document.Client);
            _serviceId  = new Id(document.Service);
            _assignedTo = new Id(document.AssignedAgent);

            _state = document.State;
        }
 public ServiceRequestDocument(ScheduledDate scheduledDate,
                               Id clientId, Id serviceId, Id assignedTo,
                               DueDate dueDate, ServiceRequestState state,
                               CompletionDate completed,
                               Version version, Id id)
 {
     this.ScheduledDate  = scheduledDate ?? new ScheduledDate(DateTime.Now);
     this.Client         = clientId;
     this.Service        = serviceId;
     this.AssignedAgent  = assignedTo ?? Guid.Empty;
     this.DueDate        = dueDate ?? new DueDate(DateTime.Now.AddDays(2));
     this.CompletionDate = completed;
     this.State          = state;
     this.Version        = version;
     this.Id             = id;
 }
Esempio n. 10
0
 public Agent(String firstName, String lastName, Version version, Id id) : base(id, version)
 {
     this.FirstName = firstName;
     this.LastName  = lastName;
 }
Esempio n. 11
0
 public User(String username, String email, String hash, DateTime creationTime, Version version, Id id) : base(id, version)
 {
     this.username     = username;
     this.email        = email;
     this.passwordHash = hash;
     this.createDt     = creationTime;
 }
Esempio n. 12
0
 protected AggregateRoot(Id id, Version version)
 {
     this.id      = id;
     this.version = version;
 }
Esempio n. 13
0
 public LoginSession(Id user, DateTime created, Version version, Id id) : base(id, version)
 {
     this.user    = user;
     this.created = created;
 }
Esempio n. 14
0
 public Task(Id agent, DueDate dueOn, string task, Version version, Id id) : base(id, version)
 {
     this._assignedTo = agent;
     this._dueOn      = dueOn;
     this._task       = task;
 }