Пример #1
0
 public async Task ExecuteAsync(Shared.PostId postId)
 {
     using (var connection = this.connectionFactory.CreateConnection())
     {
         await connection.ExecuteAsync(
             Sql,
             new { PostId = postId.Value });
     }
 }
Пример #2
0
        protected bool Equals(PostId other)
        {
            if (!object.Equals(this.Value, other.Value))
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        public async Task <bool> ExecuteAsync(UserId userId, Shared.PostId postId)
        {
            userId.AssertNotNull("userId");
            postId.AssertNotNull("postId");

            using (var connection = this.connectionFactory.CreateConnection())
            {
                return(await connection.ExecuteScalarAsync <bool>(
                           Sql,
                           new
                {
                    PostId = postId.Value,
                    UserId = userId.Value
                }));
            }
        }