MOON.ORM 3.6发布下载 及帮助文档

 

 

代码功能演示

using System;
using System.Collections.Generic;

using Moon.Orm;
using  MoonDB;

namespace r
{
    
    
    
    class Program
    {
        public static void Main(string[] args)
        {
             
            //数据添加
            PersonSet person=new PersonSet();
            person.Age=133;
            person.AgePeriod=1;
            person.IsBeiJing=true;
            person.Sex=true;
            person.UserName="";
            
            DBFactory.Add(person);
            Console.WriteLine("新的数据唯一识别标志:"+person.GetOnlyMark());
            
            //另类数据添加
            person.Set(PersonSetTable.UserName,"另类");
            person.Set(PersonSetTable.Age,12);
            person.Set(PersonSetTable.AgePeriod,11);
            person.Set(PersonSetTable.IsBeiJing,false);
            person.Set(PersonSetTable.Sex,true);
            DBFactory.Add(person);
            Console.WriteLine("新的数据11唯一识别标志:"+person.GetOnlyMark());
            
            //数据删除
            long ret= DBFactory.DeleteWhen(PersonSetTable.IsBeiJing.Equal(1).And(PersonSetTable.Age.BiggerThan(12)));
            Console.WriteLine("被删除的条数:"+ret);
            
            //改数据
             
             
            person.UserName="另类修改后";
            person.SetOnlyMark(PersonSetTable.UserName.Equal("另类"));
            DBFactory.Update(person);
            
            //查询
            PersonSet p=DBFactory.GetEntity<PersonSet>(
                PersonSetTable.UserName.Equal("另类修改后"));
            Console.WriteLine(p.Age);
            
            //查询一个字段
            int age=DBFactory.GetOneField<int>(PersonSetTable.Age, PersonSetTable.ID.Equal(5));
            Console.WriteLine(age);
             Console.Write("Press any key to continue . . . ");
            Console.ReadKey(true);
            
             
            
        }
    }
}
 

 

 

 

 

 

使用方法

优势

 

QQ群技术交流:   
     216965349

 

posted @ 2012-04-14 14:45  [秦时明月]  阅读(1279)  评论(9编辑  收藏  举报