示例#1
0
        Player IQuery <Player> .Execute(ICommandQuery commandQuery)
        {
            var sql = @"Insert into Players (FirstName, LastName, Email, Phone, RatingId, TeamId) values (@FirstName, @LastName, @Email, @Phone, @RatingId, @TeamId);
                        select cast(scope_identity() as int)";

            _player.Id = commandQuery.Query <int>(sql, _player).First();
            return(_player);
        }
示例#2
0
        Team IQuery <Team> .Execute(ICommandQuery commandQuery)
        {
            var sql = @"Insert into Teams (Gender, Name, RatingId) values (@Gender, @Name, @RatingId); 
                        select cast(scope_identity() as int)";

            _team.Id = commandQuery.Query <int>(sql, _team).First();

            return(_team);
        }
示例#3
0
 public IEnumerable <Rating> Execute(ICommandQuery commandQuery)
 {
     return(commandQuery.Query <Rating>("select * from Ratings"));
 }