Beispiel #1
0
        public async Task <IEnumerable <Category> > GetCategoriesByOwner(ulong ownerId)
        {
            using var dbConnection = await dbConnectionFactory.CreateConnection();

            var cmdText =
                "Select category.id Id, category.name Name, category.owner OwnerId FROM category " +
                "WHERE category.owner = @ownerId;";
            var parameters = new
            {
                ownerId
            };

            return(await dbConnection.QueryAsync <Category>(cmdText, parameters));
        }
Beispiel #2
0
        public async Task <AudioOwner> GetById(uint id)
        {
            using var dbConnection = await dbConnectionFactory.CreateConnection();

            var cmdText    = "SELECT id Id, audio AudioId, owner OwnerId, name Name FROM audio_owner WHERE id = @id;";
            var parameters = new { id };

            return(await dbConnection.QueryFirstAsync <AudioOwner>(cmdText, parameters));
        }