public bool AddClub(AddClubCommand newClub) { using (var connection = new SqlConnection(_connectionString)) { connection.Open(); var addClub = @"INSERT INTO [dbo].[Club] ([Name] ,[Address] ,[Phone] ,[Capacity] ,[Description]) output inserted.* VALUES (@name ,@address ,@phone ,@capacity ,@description)"; var parameters = new { name = newClub.Name, address = newClub.Address, phone = newClub.Phone, capacity = newClub.Capacity, description = newClub.Description }; var rowsAffected = connection.Execute(addClub, parameters); return(rowsAffected == 1); } }
public void AddClub(AddClubCommand newClub) { var repo = new ClubRepository(); repo.AddClub(newClub); }