コード例 #1
0
        public int AddGuest(AddGuestCommand addGuestCommand)
        {
            using (var db = new SqlConnection(_connectionString))
            {
                var sql = @"insert into [dbo].[Guests]([firstName], [lastName], [Address], [Relationship], [RSVP], [City], [State])
                            values
                            (
	                            @firstName,
	                            @lastName,
	                            @Address,
	                            @Relationship,
	                            @RSVP,
	                            @City,
	                            @State
                            )";
                return(db.Execute(sql, addGuestCommand));
            }
        }
コード例 #2
0
        public int NewGuest(AddGuestCommand addGuestCommand)
        {
            var repo = new GuestsRepository();

            return(repo.AddGuest(addGuestCommand));
        }