public static UserEdit Create(Guid id, string externalId, string userName, string fullName, string email) { var user = new UserEdit() { Id = id, ExternalId = externalId, UserName = userName, FullName = fullName, Email = email, Status = EUserStatus.Active }; var audit = new AuditValue(); audit.Create(AuditHelper.UserName, AuditHelper.MachineName, AuditHelper.UtcDateTime); user.Audit = audit; MarkAsNew(); DomainEvents.Raise(new UserCreatedEvent() { User = user }); return(user); }
public static OwnerEdit Create(Guid id, string name) { var owner = new OwnerEdit { Id = id, Name = name, Status = EOwnerStatus.Active }; var audit = new AuditValue(); audit.Create(AuditHelper.UserName, AuditHelper.MachineName, AuditHelper.UtcDateTime); owner.Audit = audit; MarkAsNew(); DomainEvents.Raise(new OwnerCreateEvent() { Owner = owner }); return(owner); }