Пример #1
0
        // 수정
        public Maxim UpdateMaxim(Maxim model)
        {
            string sql = @"Update Maxims 
                Set Name = @Name, Content = @Content Where Id = @Id";

            this.db.Execute(sql, model);
            return(model);
        }
Пример #2
0
        //입력
        public Maxim AddMaxim(Maxim model)
        {
            string sql = @"Insert Into Maxims(Name, Content) Values (@Name, @Content); Select Cast(SCOPE_IDENTITY() As Int);";
            var    id  = this.db.Query <int>(sql, model).Single();

            model.Id = id;

            return(model);
        }