示例#1
0
        public static bool Insert(Section section)
        {
            using (var context = Context())
               {
               int id = context.Insert<Section>("Section", section)
                   .AutoMap(x => x.SectionId)
                   .ExecuteReturnLastId<int>();

               section.SectionId = id;
               return id > 0;
               }
        }
示例#2
0
 public static bool Update(Section section)
 {
     using (var context = Context())
        {
        return context.Update<Section>("Section", section)
            .AutoMap(x => x.SectionId)
                                 .Where("SectionId", section.SectionId)
                                .Execute() > 0;
        }
 }
示例#3
0
 public static bool Delete(Section section)
 {
     return Delete(section.SectionId);
 }