public bool AddNewOccasion(AddOccasionDTO occasionToAdd) { using (var db = new SqlConnection(_connectionString)) { var sql = @"INSERT INTO[dbo].[Occasion] ([Name] ,[Description]) VALUES (@Name , @Description)"; return(db.Execute(sql, occasionToAdd) == 1); } }
public IEnumerable <Occasion> AddOccasion(AddOccasionDTO occasionToAdd) { _repo.AddNewOccasion(occasionToAdd); return(_repo.GetAllOccasions()); }