internal IChannel Create(INewChannel c) { try { string Id = Guid.NewGuid().ToString(); int id = _db.ExecuteScalar <int>(@" INSERT INTO channels(Id, Name, OwnerId) VALUES(@Id, @Name, @OwnerId); SELECT LAST_INSERT_ID(); ", new { Id, c.Name, c.OwnerId }); return(new Channel() { Id = Id, Name = c.Name, OwnerId = c.OwnerId }); } catch (MySqlException e) { throw e; } }
public IChannel CreateChannel(INewChannel channel) { return(_provider.Create(channel)); }
public IChannel Create(INewChannel c) { return(_repo.Create(c)); }