protected override Command CreateDeleteCommand(User entity, IAuthenticatedUser user, string selector)
 {
     return(Command
            .NonQuery()
            .Connection(RegisterUserConnectionClass.GetConnectionName())
            .StoredProcedure("[UserBoundedContext].[pUser_Delete]")
            .Parameters(
                p => p.Name("userId").Value(entity.Id)
                ));
 }
        public User GetUserByUserName(string username)
        {
            var result = Query <User>
                         .Single()
                         .Connection(RegisterUserConnectionClass.GetConnectionName())
                         .StoredProcedure("[UserBoundedContext].[pUser_GetUserByUserName]")
                         .Parameters(
                p => p.Name("username").Value(username)
                )
                         .Execute();

            return(result.Record);
        }
        protected override Command CreateInsertCommand(User entity, IAuthenticatedUser user, string selector)
        {
            var command = Query <User>
                          .Single()
                          .Connection(RegisterUserConnectionClass.GetConnectionName())
                          .StoredProcedure("[UserBoundedContext].[pUser_Insert]")
                          .Parameters(
                p => p.Name("username").Value(entity.Username),
                p => p.Name("passwordSalt").Value(entity.PasswordSalt),
                p => p.Name("passwordHash").Value(entity.PasswordHash),
                p => p.Name("email").Value(entity.Email)
                )
                          .RecordInstance(entity)
                          .MapProperties(
                p => p.Name("Id").Index(0),
                p => p.Name("SubjectId").Index(1)
                );

            return(command);
        }
示例#4
0
 public RegisterUserCommandAggregate(RegisterUserInputDto user, EntityDependency[] dependencies = null) : base(new DomainFramework.DataAccess.RepositoryContext(RegisterUserConnectionClass.GetConnectionName()))
 {
     Initialize(user, dependencies);
 }
示例#5
0
 public RegisterUserCommandAggregate() : base(new DomainFramework.DataAccess.RepositoryContext(RegisterUserConnectionClass.GetConnectionName()))
 {
 }
示例#6
0
        public GetUserByUserNameQueryAggregate() : base(new DomainFramework.DataAccess.RepositoryContext(RegisterUserConnectionClass.GetConnectionName()))
        {
            var context = (DomainFramework.DataAccess.RepositoryContext)RepositoryContext;

            UserQueryRepository.Register(context);
        }