コード例 #1
0
 internal IChannelRoom Create(INewRoom r)
 {
     try
     {
         string Id = Guid.NewGuid().ToString();
         int    id = _db.ExecuteScalar <int>(@"
         INSERT INTO channels(Id, Name, OwnerId)
         VALUES(@Id, @Name, @OwnerId, @RoomId);
         SELECT LAST_INSERT_ID();
         ", new
         {
             Id,
             r.Name,
             r.OwnerId
         });
         return(new ChannelRoom()
         {
             Id = Id,
             Name = r.Name,
             OwnerId = r.OwnerId
         });
     }
     catch (MySqlException e)
     {
         throw e;
     }
 }
コード例 #2
0
        internal void CreateChannelRoom(INewRoom room)
        {
            var id = Guid.NewGuid().ToString();

            _db.ExecuteScalar(@"
             INSERT INTO ChannelRooms (Id, ChannelId, OwnerId, Name)
             VALUES (@id, @channelId, @ownerId, @name)
            ");
        }
コード例 #3
0
 public IRoom Create(INewRoom r)
 {
     return(_repo.Create(r));
 }
コード例 #4
0
 public NewRoomUniqueValidation(IRoomRepository roomRepo, INewRoom newRoom)
 {
     this.roomRepo = roomRepo;
     this.newRoom  = newRoom;
 }
コード例 #5
0
 public void CreateChannelRoom(INewRoom room)
 {
     _provider.CreateChannelRoom(room);
 }
コード例 #6
0
 public RoomController(INewRoom newRoom)
 {
     this.newRoom = newRoom;
 }
コード例 #7
0
 public void CreateChannelRoom(INewRoom room)
 {
     _repo.CreateChannelRoom(room);
 }
コード例 #8
0
 public NewRoomCinemaValidation(ICinemaRepository cinemaRepo, INewRoom newRoom)
 {
     this.cinemaRepo = cinemaRepo;
     this.newRoom    = newRoom;
 }