Ejemplo n.º 1
0
        public async Task CreatePostAsync(string Text, int threadId, Guid userId, string UserName)
        {
            using (var cmd = _repo.CreateCommand())
            {
                cmd.CommandText = $"Insert into Posts (Text,ThreadId,UserId,UserName) Values('{Text}',{threadId},'{userId}','{UserName}')";
                await cmd.ExecuteNonQueryAsync();

                _repo.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public async Task CreateThreadAsync(string Name, string Text, int TopicId, Guid UserId, string UserName)
        {
            using (var cmd = _repo.CreateCommand())
            {
                cmd.CommandText = $"Insert into Threads (Name,TextDescription,TopicId,UserId,CreatedAt,UserName) Values('{Name}','{Text}',{TopicId},'{UserId}','{DateTime.Now:s}','{UserName}')";
                await cmd.ExecuteNonQueryAsync();

                _repo.SaveChanges();
            }
        }
Ejemplo n.º 3
0
        public async Task CreateTopicAsync(string Name)
        {
            using (var cmd = _repo.CreateCommand())
            {
                cmd.CommandText = $"Insert into Topics (Name) Values('{Name}')";
                await cmd.ExecuteNonQueryAsync();

                _repo.SaveChanges();
            }
        }