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; } }
internal void CreateChannelRoom(INewRoom room) { var id = Guid.NewGuid().ToString(); _db.ExecuteScalar(@" INSERT INTO ChannelRooms (Id, ChannelId, OwnerId, Name) VALUES (@id, @channelId, @ownerId, @name) "); }
public IRoom Create(INewRoom r) { return(_repo.Create(r)); }
public NewRoomUniqueValidation(IRoomRepository roomRepo, INewRoom newRoom) { this.roomRepo = roomRepo; this.newRoom = newRoom; }
public void CreateChannelRoom(INewRoom room) { _provider.CreateChannelRoom(room); }
public RoomController(INewRoom newRoom) { this.newRoom = newRoom; }
public void CreateChannelRoom(INewRoom room) { _repo.CreateChannelRoom(room); }
public NewRoomCinemaValidation(ICinemaRepository cinemaRepo, INewRoom newRoom) { this.cinemaRepo = cinemaRepo; this.newRoom = newRoom; }